Multi-Tenant Resource Server

This bonus lab demonstrates the multi-tenancy feature of Spring Security.

To start the resource server just run the class com.example.multitenant.MultiTenantServerAppApplication.

Provided API

This resource server just provides one API at http://localhost:9090. The API is secured and is only accessible by specifying a bearer JSON web token as Authorization header.

The resource server is configured as multi-tenant and as such it accepts access tokens by the following identity providers:

To call the API use the following commands (Httpie or Curl). You may also use Postman instead if you like a UI more,

httpie

http localhost:9090 'Authorization: Bearer [access_token]'

curl

curl -H 'Authorization: Bearer [access_token]' \
-v http://localhost:9090 | jq

Using OKTA

To get an access token from Okta use one of the following commands.

httpie

curl

Using Auth0

To get an access token from Auth0 use one of the following commands.

httpie

curl

Last updated

Was this helpful?