Introduction

Web application that provides an SSO gateway to unify institutional and third-party SSO providers.

Discovery Endpoints

OAuth2 / OpenId Connect discovery (metadata) endpoints can be found at the following well-known paths.

  • OAuth2

    • URI(s): https://[tier: dev,pprd].gateway.login.vt.edu/.well-known/oauth-authorization-server

      • Exclude tier for production instance (e.g. 'https://gateway.login…​')

  • OpenId Connect

    • URI(s): https://[tier: dev,pprd].gateway.login.vt.edu/.well-known/openid-configuration

      • Exclude tier for production instance (e.g. 'https://gateway.login…​')

Setting up your App

Using the Gateway service is a multi-step process.

  1. Create an Enterprise Directory group - or use an existing group - that will be the backing group for your developer team. Note: you must be an admin on the group used for your team. Each team member must be a member of the backing group. Select the desired tier based on needs (must use the same App Manager tier).

  2. Create a Developer Team via App manager. Select the desired tier below based on needs.

    1. Select Create Developer Team (if you don’t have one already)

    2. Choose a group from the dropdown

  3. Create an app under the newly created team

    1. Click the Create App button on the App Manager homepage.

    2. Choose a Developer Team from the dropdown.

    3. Choose a name for your team.

    4. Create App.

    5. You should now be on the Dashboard for the new app.

      1. The Client Id and Client Secret are the credentials used for communicating with the Gateway service.

      2. Register a new O-Protocol Endpoint. This is the callback endpoint in your app/service that will handle auth/tokenn responses from Gateway. e.g. https://my.app.vt.edu/secure

    6. App Manager Tiers

Authentication

The Gateway API requires different authentication methods depending on the endpoint being accessed.

Client Authentication

Endpoints secured by HTTP Basic authentication (i.e. client secret).

  • /oauth2/token  — Token exchange

  • /oauth2/tinfo  — Token info

  • /oauth2/revoke  — Token revocation

Credentials may be specified by either of the following mechanisms:

  1. HTTP Basic scheme

  2. POST parameters client_id and client_secret per [RFC 6749, section 2.3.1](https://datatracker.ietf.org/doc/html/rfc6749#section-2.3.1)

User Authentication

Endpoints security by HTTP Bearer authentication (Access Token).

  • /oidc/uinfo  — User info

  • /oauth2/admin/tokens — Administrative token revocation

  • /oauth2/user/tokens  —  User-initiated token revocation

Gateway API

Authorize

GET /oauth2/authorize

OAuth2 AUTHORIZATION endpoint with support for PKCE. The parameters are those supported by the AWS Cognito AUTHORIZATION Endpoint as this endpoint proxies to the AWS endpoint.

Authorization

HTTP Auth is not required.

Query Parameters

Parameter Optional Description

response_type

false

OAuth2 response_type parameter.

client_id

false

OAuth2 client_id parameter.

redirect_uri

false

OAuth2 redirect_uri parameter.

state

true

OAuth2 state parameter.

scope

true

OAuth2 scope parameter.

nonce

true

OIDC nonce parameter.

code_challenge_method

true

OAuth2 PKCE code_challenge_method parameter.

code_challenge

true

OAuth2 PKCE code_challenge parameter.

enable_create_guest

true

Flag indicating that a user should be presented with the option to create a guest account.

onboard_success_create

true

Flag indicating that a user is coming back from Onboard after successfully creating a new account. This is not intended to be set directly by a client and doing so will prevent a user from seeing the Gateway discovery page.

Example Request

$ curl 'http://localhost:8080/oauth2/authorize?response_type=code&client_id=lota&redirect_uri=https%3A%2F%2Flota.example.com&state=LOTA874ABC&scope=profile+openid' -i -X GET

Example Response

HTTP/1.1 302 Found
Location: http://localhost:8080/?state=HCJ6FpZNShsl61cam7b7bD

Example Error Response

HTTP/1.1 302 Found
Location: https://client-inactive.example.com?error=unauthorized_client&error_description=Client%20is%20inactive

Token: Code Exchange

POST /oauth2/token

OAuth2 TOKEN endpoint for the code flow with support for PKCE. The parameters are those supported by the AWS Cognito TOKEN endpoint as this endpoint proxies to the AWS endpoint.

Authorization

The client must pass its client_id and client_secret in the authorization header through Basic HTTP authorization via HEADER. The secret is Basic Base64Encode(client_id:client_secret).

Form Parameters

Parameter Optional Description

grant_type

false

OAuth2 grant_type parameter.

redirect_uri

false

OAuth2 redirect_uri parameter.

code

false

OAuth2 code parameter.

code_verifier

true

OAuth2 PKCE code_verifier parameter.

Example Request

$ curl 'http://localhost:8080/oauth2/token' -i -u 'jolene:j' -X POST \
    -d 'grant_type=authorization_code&code=PR0X1ED&redirect_uri=https%3A%2F%2Fjolene.example.com'

Example Response

HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Cache-Control: no-store
Pragma: no-cache
X-Content-Type-Options: nosniff
X-XSS-Protection: 0
X-Frame-Options: DENY
Content-Length: 2317

{"token_type":"bearer","expires_in":3000,"scope":"openid email name","access_token":"eyJraWQiOiIyNzE4MzgyMTM0MDE2NzEyMzAwOTE4IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJkNjViOWExNy1hYjUwLTQ4NDctYWM4Ny00YzM0Y2ZiY2Q2NGEiLCJhdWQiOiJqb2xlbmUiLCJzY29wZSI6WyJvcGVuaWQiLCJlbWFpbCIsIm5hbWUiXSwiaXNzIjoic29tZWJvZHkiLCJhY3RpdmUiOnRydWUsImV4cCI6MTY5MjU4NjMxMywiaWF0IjoxNjkyNTgzMzEzLCJ0dGwiOjMwMDAsImp0aSI6IlVaQlQzTkxCWVNNWTQzTEhEMzRHVlNLSEZYVktHU0dBTiJ9.uOuZU4HnPdqq15rSWHvuJOpJcG--xe7Spvc8pcKM5qff28F4VWVOAGf29jGu3W0SInSdy8QlKTLeXaGYOpGP4alep0FxpF6LTKXQ6r3t0MY463AjXKq0k1MPgCpjHTU0KlNj5hx3H52VS3BQp9G3q-kG-7Jn80MwFx4lvgEEU-UYn75_hoEX58_VhpiGVpqA3l-F2vWMAnaAeZ03TNsRQHRUwoJTyq2_vm389DM9Gu9a3PIRiyugdAyeHWoh_Uj2uPyoG_VVv7VNxZaNyffloP-Pmmk9eYiym5XSsQjYRBn9pksxbO0FwtWw7idqq_ghe6cf4MoCuZIKOW9m5ZLBzA","refresh_token":"eyJraWQiOiIyNzE4MzgyMTM0MDE2NzEyMzAwOTE4IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJkNjViOWExNy1hYjUwLTQ4NDctYWM4Ny00YzM0Y2ZiY2Q2NGEiLCJhdWQiOiJqb2xlbmUiLCJzY29wZSI6WyJvcGVuaWQiLCJlbWFpbCIsIm5hbWUiXSwiaXNzIjoic29tZWJvZHkiLCJhY3RpdmUiOnRydWUsImV4cCI6MTY5MjU4OTMxMywiaWF0IjoxNjkyNTgzMzEzLCJ0dGwiOjYwMDAsImp0aSI6IlNBRUNMWlRYV0w3S1IyREtESDgzOEtESFQ2Tk1YVEJaM0lJNFJHREhIVjQzSVZBRiJ9.PVg8lW38duB9J-R_5XVs3_8r0UO1IuoiQU2nJvpEtOusT3E0Wov4xld9gUHzYRG6lte4j3PYtPna98kAnNak5An6G0HjDuHdo97fspeqZ8jE4YP6UsEYpvm2Xerto4zfyn4I_l2vmnNqrQxtRSi4sQIAz3LZc2MJIJyPICpYQjO6oS09JEMonzFKmfc6AIIsijxqn4qNrNWwsYk9LNloALB-iPpFuhrirsgkaeTJEMQ965PUyy3ZBCOnjuigUduKfOWkbKKkFdf5WgVOvEPELNZ_1rFrXz9sTf4ImtnLy28noXfUnGUKWwYEaVAMvVLC90kl0oPVugIC80j7shXpmg","id_token":"eyJraWQiOiIyNzE4MzgyMTM0MDE2NzEyMzAwOTE4IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJkNjViOWExNy1hYjUwLTQ4NDctYWM4Ny00YzM0Y2ZiY2Q2NGEiLCJpc3MiOiJzb21lYm9keSIsImFjdGl2ZSI6dHJ1ZSwidHRsIjozMDAwLCJub25jZSI6IkhES0QtOEg3JEhELUtESEE4TCIsImF1ZCI6ImpvbGVuZSIsInNjb3BlIjpbIm9wZW5pZCIsImVtYWlsIiwibmFtZSJdLCJuYW1lIjoiSm9sZW5lIEpvbGUiLCJleHAiOjE2OTI1ODYzMTMsImlhdCI6MTY5MjU4MzMxMywianRpIjoiN0tSMlQyRUFYNlFCTFREODM4SERLRExEM0lWQUZTQUVDTFpUWFdMIiwiZW1haWwiOiJqb2xlbmVAdnQuZWR1In0.HL49IBLjGNs7W3i2xLZBzM3KmsX0pBNjWjXXNyEk9W_mv3Q9zos_o5uJOY4xJTD5JCTzgp2jIoAaKN2KnthlYAXFqxLbHtcC5-fqJbuFG4ja1TFrLV695pLAIsK9Xq4K31BD0Cf4EEzrCUWHQ6LUrSHfRv-AlpCwMCCxCzwDm-CMc_xAFwKro6bwWZG7jfITL39aSsyaN9pOXs3iegAD7bP_AEjTYJ3JIW5kDxwFqU8JDLpsgRPAg666rFPuIYby3SHMC6NWCBeMhLRDsMRZ3RFYueHHst-BDgwc6oEpwwiKExLreyJhzrMMosNsrWzHAeJ2QAwKBdYCaxJCUYK7Eg"}

Example Error Response

HTTP/1.1 400 Bad Request
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Cache-Control: no-store
Pragma: no-cache
X-Content-Type-Options: nosniff
X-XSS-Protection: 0
X-Frame-Options: DENY
Content-Length: 105

{
  "error" : "unsupported_grant_type",
  "error_description" : "Grant type must be authorization_code"
}

Token: Refresh Token Exchange

POST /oauth2/token

OAuth2 TOKEN endpoint for handling refresh token requests.

Authorization

The client must pass its client_id and client_secret in the authorization header through Basic HTTP authorization via HEADER. The secret is Basic Base64Encode(client_id:client_secret).

Form Parameters

Parameter Optional Description

grant_type

false

OAuth2 grant_type parameter.

refresh_token

false

OAuth2 refresh_token parameter.

scope

true

OAuth2 scope parameter

Example Request

$ curl 'http://localhost:8080/oauth2/token' -i -u 'rho:r' -X POST \
    -d 'grant_type=refresh_token&refresh_token=eyJraWQiOiIyNzE4MzgyMTM0MDE2NzEyMzAwOTE4IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiI2YmQ4NGQ5MS1hMDA2LTRjZDQtYjY2Zi01NjY0ZjlmN2E4OTYiLCJhdWQiOiJyaG8iLCJzY29wZSI6WyJ0aGUtc2NvcGUiXSwiaXNzIjoic29tZWJvZHkiLCJhY3RpdmUiOnRydWUsImV4cCI6MTY5MjU4OTMxMywiaWF0IjoxNjkyNTgzMzEzLCJ0dGwiOjYwMDAsImp0aSI6IlZZTEpIT0FURVo2V1M0QjZRV1JVWERTN0dIUkpYNFdaUTdZSklVVlNKWloifQ.pZ7M_v_4FW6CpNOEWK3w-1f4UI039EWhdOI8U2h7qjGgPjzibCl_pp4s6RLnjSVWRg37WXipWpIKVf7OqjgjVF0uNpPTxqvWLoLffYfRu-LrYD3sN4I9A9luqxJLKcvJiuMEB2QTRYYcadpS6gvjHtxlThes49j8VtccvNiuvVAjM1tBfjzU4oUuIqSxqXEMahH4iYWqBlcXvGf6HZ9K_ojFJjVzULQYRy7ooBTW6CauopKFyEYTXqyKh3fqs33I_k2YEtugLrwNYPsgNrPS0cqKLCjzqvmoLzA0KMaOeTgJMF2-QsGMuObIStnbYecKufkKJeqbpU3blwIccGdEzw&scope=the-scope'

Example Response

HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Cache-Control: no-store
Pragma: no-cache
X-Content-Type-Options: nosniff
X-XSS-Protection: 0
X-Frame-Options: DENY
Content-Length: 1448

{"token_type":"bearer","expires_in":3000,"scope":"the-scope","access_token":"eyJraWQiOiIyNzE4MzgyMTM0MDE2NzEyMzAwOTE4IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiI2YmQ4NGQ5MS1hMDA2LTRjZDQtYjY2Zi01NjY0ZjlmN2E4OTYiLCJhdWQiOiJyaG8iLCJzY29wZSI6WyJ0aGUtc2NvcGUiXSwiaXNzIjoic29tZWJvZHkiLCJhY3RpdmUiOnRydWUsImV4cCI6MTY5MjU4NjMxMywiaWF0IjoxNjkyNTgzMzEzLCJ0dGwiOjMwMDAsImp0aSI6ImI3NWFiOWI0LTc2ZDItNDc5MC04N2FhLWY0YjdhOTYyNTE2YSJ9.VtYZFNEHwzvvwnQywDEArXzQfKHFblFinOfrgMHEe7kV4P5J4loa0jKsGstamYTeIQ89eH-e9rM9Rc3vPwk7_Jy5rFE_rGZKrD25DQw0kmzr3ZkMSxV2Mm9vXzZ8qVHqd53UgJyvbDST1-9EfFjSCHUk9fSUdsYers0S7EJmfrDy5okFcZuh2tWmSEqENeUA5S55jdfN9ZEJsSiEeUe6kpBWKVHulyJ5veGvYqbOIye8985neFjlTe9pboZC4u-WRoEMdvDRNEZE_cA4GAH8iCwot5kPS-UUga4eeW7AEj69uWmDYDq0UdUwm3r58kU4QCUEn8XQmeEVe7-w-1GH8w","refresh_token":"eyJraWQiOiIyNzE4MzgyMTM0MDE2NzEyMzAwOTE4IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiI2YmQ4NGQ5MS1hMDA2LTRjZDQtYjY2Zi01NjY0ZjlmN2E4OTYiLCJhdWQiOiJyaG8iLCJzY29wZSI6WyJ0aGUtc2NvcGUiXSwiaXNzIjoic29tZWJvZHkiLCJhY3RpdmUiOnRydWUsImV4cCI6MTY5MjY0MzMxMywiaWF0IjoxNjkyNTgzMzEzLCJ0dGwiOjYwMDAwLCJqdGkiOiJlZmEzMGY2Ni1mOWIyLTQxYmItOGE1My0xMTk3ZTUzMDhkNWIifQ.NrSxfrmRyyuTB4U3x0exy3LCM3H-yXDy4s_hF_951HjWMopA2lyARRU8EIIUjJeu0szCdnaDfor1_DtVwO4_tX6a0xBDcYiKI7GQJqKlJnsm8Z0KptMSFXjFlmAchkD2ilJxs5HLM6iZ3OHw4IUr9SSrHKreFzzYuCaE6ekyDYfrZZf0XsJOdSreuHuQDGDOmdmjTs9Cn9KCNqjd2Zg-GoDhazDQLFmnn2GVOW2OFw5HdtDChweDCYzypBpeMaVuachsgkxIo04AXSuu1Y5OqjiWgRn4getz7nvHb0uCCHRszRUmtgk9lYSOu_iS8NzLdopNp1ZY76AJQIDSIgxIlw"}

Example Error Response

HTTP/1.1 400 Bad Request
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Cache-Control: no-store
Pragma: no-cache
X-Content-Type-Options: nosniff
X-XSS-Protection: 0
X-Frame-Options: DENY
Content-Length: 80

{
  "error" : "invalid_grant",
  "error_description" : "Invalid refresh token"
}

Token: Client Credentials Grant

POST /oauth2/token

OAuth2 TOKEN endpoint for the client_credentials flow as described here.

Authorization

The client must pass its client_id and client_secret in the authorization header through Basic HTTP authorization via HEADER. The secret is Basic Base64Encode(client_id:client_secret).

Form Parameters

Parameter Optional Description

grant_type

false

OAuth2 grant_type parameter. Value must be client_credentials.

scope

true

OAuth2 scope parameter.

Example Request

$ curl 'http://localhost:8080/oauth2/token' -i -u '12345678-90b0-1002-a0a1-ffbbbb923df0:s' -X POST \
    -d 'grant_type=client_credentials&scope=c'

Example Response

HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Cache-Control: no-store
Pragma: no-cache
X-Content-Type-Options: nosniff
X-XSS-Protection: 0
X-Frame-Options: DENY
Content-Length: 804

{"token_type":"bearer","expires_in":3000,"scope":"c","access_token":"eyJraWQiOiIyNzE4MzgyMTM0MDE2NzEyMzAwOTE4IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJkNTM0NGQ3Yi03MDAxLTQzMTAtYWE1Yi05YmYxOTUxMThmZWUiLCJhdWQiOiIxMjM0NTY3OC05MGIwLTEwMDItYTBhMS1mZmJiYmI5MjNkZjAiLCJzY29wZSI6WyJjIl0sImlzcyI6InNvbWVib2R5IiwiYWN0aXZlIjp0cnVlLCJleHAiOjE2OTI1ODYzMTMsImlhdCI6MTY5MjU4MzMxMywidHRsIjozMDAwLCJqdGkiOiIzMzVhYTE2ZC0xNDM3LTQzYTctODdlNS01ODVmNDA1NzBhZjIiLCJ1c2VybmFtZSI6InNpZ21hIn0.GzEfG48DekvswCt0hedx7vFbsDWldiKC5wtpQMgIyoHFHCG5L3vJ7Th7wK6QtM2eSQ6B3K8Yj2OF4FoyR_gWNh1DLhgrCTCMNmXy1JVXTmWb8E-BI1oChOGFtlzevIvXM5xwMjoCW-VXUfZimpgfOgyzkpA7LgcTY2T67Md7sK06_2MzKYX6izwvwnsAPXZScRpNW-oJU30t7RO79zaT_HG4KS0bkVz1fg8dVZVof_HQNFIAkfOxxNoPWNiXoF2l-p_KwGKv8W65OdVrz8KOmJsEek3bEC2L8mwVwNA_wu3CewdIwFikPpQ7FUTM_pXp5AtMW2O78U0lr1hkDlmyMw"}

Example Error Response

HTTP/1.1 401 Unauthorized
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
WWW-Authenticate: Basic
Content-Type: application/json
Cache-Control: no-store
Pragma: no-cache
X-Content-Type-Options: nosniff
X-XSS-Protection: 0
X-Frame-Options: DENY
Content-Length: 79

{
  "error" : "invalid_client",
  "error_description" : "Invalid credentials"
}

Revoke: Client-Initiated

POST /oauth2/revoke

Authorization

The client must pass its client_id and client_secret in the authorization header through Basic HTTP authorization via HEADER. The secret is Basic Base64Encode(client_id:client_secret).

Form Parameters

Parameter Optional Description

token

false

The token that the client wants to be revoked.

token_type_hint

true

Token type hint.

Example Request

$ curl 'http://localhost:8080/oauth2/revoke' -i -u 'client-id-a:clientAPassword' -X POST \
    -d 'token=eyJraWQiOiIyNzE4MzgyMTM0MDE2NzEyMzAwOTE4IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJjbGllbnQtaWQtYSIsImF1ZCI6ImNsaWVudC1pZC1hIiwic2NvcGUiOiJvcGVuaWQiLCJleHAiOjE2OTI1ODgzMDcsImlhdCI6MTY5MjU4MzMwNywidHRsIjo1MDAwLCJqdGkiOiJ0b2tlbi10by1yZXZva2UtaWQifQ.vXqW1QEl2G46gKQLRBQOsAgOPlrmcGPC6i6YJmQuG1-ADG7JDS3kjAnU0NI_8eFmCozMwDpNExpyEppRHsmGiTxs2j0-CBHVlVCt18GXYOAmCoOwXD0m1bREQ5AlPPJEl8zfDADqWZ9X4v_T4ykbfPtBFZEi1AbsXgEbNo4HSyFeEVqK70pwK24UYtochIgmgq94-kkGdRar_28WjgsFyDDGR5zrwNskQF1HdBLQbXqdTOvDfC2dn3mB22PKECkqeCeoyx2XFn-Paxso0WCVTLeb3Kg7o1Fe_wMJB4x25Vzz8AH3NX3K0QLuvy1g9DROHyoOdnoYG-RqMU5ZTpdAaw'

Example Response

HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: text/plain;charset=UTF-8
X-Content-Type-Options: nosniff
X-XSS-Protection: 0
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY

Example Error Response

HTTP/1.1 503 Service Unavailable
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Cache-Control: no-store
Pragma: no-cache
X-Content-Type-Options: nosniff
X-XSS-Protection: 0
X-Frame-Options: DENY
Content-Length: 108

{
  "error" : "operation_failed",
  "error_description" : "Token still exists with ID: token-to-revoke-id"
}

Revoke: Client-Initiated Batch

POST /oauth2/client/tokens

OAuth2 revocation endpoint for revoking ALL tokens that were created for the authenticated client.

Authorization

The client must pass its client_id and client_secret in the authorization header through Basic HTTP authorization via HEADER. The secret is Basic Base64Encode(client_id:client_secret).

Example Request

$ curl 'http://localhost:8080/oauth2/client/tokens' -i -u 'client-id-ra:clientRaPassword' -X POST

Example Response

HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: text/plain;charset=UTF-8
X-Content-Type-Options: nosniff
X-XSS-Protection: 0
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY

Example Error Response

HTTP/1.1 401 Unauthorized
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
WWW-Authenticate: Basic
Content-Type: application/json
Cache-Control: no-store
Pragma: no-cache
X-Content-Type-Options: nosniff
X-XSS-Protection: 0
X-Frame-Options: DENY
Content-Length: 79

{
  "error" : "invalid_client",
  "error_description" : "Invalid credentials"
}

Revoke: User-Initiated

POST /oauth2/user/tokens

User-initiated OAuth2 revocation endpoint for removing all tokens belonging to the requesting user. If the optional client_id parameter is provided, all tokens issued to the user for the given client will be removed. Otherwise, all tokens with a user uid matching the user UID of the access token used for authentication will be removed.

Authorization

Bearer <access_token>. Pass the access token using the authorization header field.

Form Parameters

Parameter Optional Description

client_id

true

ID of a client used to narrow the user token revocation.

Example Request

$ curl 'http://localhost:8080/oauth2/user/tokens' -i -X POST \
    -H 'Authorization: Bearer eyJraWQiOiIyNzE4MzgyMTM0MDE2NzEyMzAwOTE4IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJqZGpka2FES0ZrZCIsImF1ZCI6InNvbWUtY2xpZW50Iiwic2NvcGUiOiJvcGVuaWQiLCJleHAiOjE2OTI1ODgzMDcsImlhdCI6MTY5MjU4MzMwNywidHRsIjo1MDAwLCJqdGkiOiJBTEtESERMS0RIS0Q5Njg3SkhLSCJ9.bjLNSdqV_BJqm3--3KcPL5LnhR8VSV6bWrg6P66KU3vILnFjWRHtliz1Dj8gqv6lnLIvUgSpN1aOBFH1EL16_raoMo2B7IxNlQblCF_UO5lc_xJbY6anazTGM0hQlKjt85tFh9NtAukibkhvubu9L9Z-sk_CqGg8fSCBjYbUwQo5d_rHAZUpbuES07ZRgi7H9o5nPzyymZrT0fgt62iEDDQN9bm5AHDBc4qTDWkvosgV74KHLPMHQe7mq8X4S8xpfA18Vf7kyG0tB1v5lE1nOQRxlvi6ngYFmIKCoGtGAWbF6rdrx_hfc2zUy5R6zz90NKnxyZ_FYeaUMTffyButfw' \
    -d 'client_id=some-client'

Example Response

HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: text/plain;charset=UTF-8
X-Content-Type-Options: nosniff
X-XSS-Protection: 0
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY

Example Error Response

HTTP/1.1 503 Service Unavailable
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Cache-Control: no-store
Pragma: no-cache
X-Content-Type-Options: nosniff
X-XSS-Protection: 0
X-Frame-Options: DENY
Content-Length: 102

{
  "error" : "operation_failed",
  "error_description" : "1 tokens remain after revocation attempt"
}

Revoke: Admin-Initiated

POST /oauth2/admin/tokens

Administrative token revocation endpoint with the following options:

  • Revoke ALL tokens issued by a specific client (client_id).

  • Revoke ALL tokens issued to a specific user (uid).

  • Revoke ALL tokens with a specific sub claim (sub).

  • Revoke ALL tokens issued to a user by a specific client (client_id, uid)

Note: At least 1 parameter is required.

Authorization

Bearer <access_token>. Pass the access token using the authorization header field.

Form Parameters

Parameter Optional Description

client_id

true

ID of a client to revoke tokens for.

sub

true

Subject claim of the tokens to be revoked.

uid

true

UID attribute of person whose tokens should be revoked.

Example Request

$ curl 'http://localhost:8080/oauth2/admin/tokens' -i -X POST \
    -H 'Authorization: Bearer eyJraWQiOiIyNzE4MzgyMTM0MDE2NzEyMzAwOTE4IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJhZG1pbiIsImF1ZCI6ImFkbWluLWNsaWVudCIsInNjb3BlIjpbIm9wZW5pZCIsImdhdGV3YXk6b2F1dGgyL3Rva2Vucy9hZG1pbiJdLCJleHAiOjE2OTI1ODgzMDcsImlhdCI6MTY5MjU4MzMwNywidHRsIjo1MDAwLCJqdGkiOiJBRE1JTjFVU0VSIn0.fhGlUdZgz5pwD48MWDGApw7WZQhqdbN6MoieILubqWq8dtEmI1jsghXkqCe9S2VpxEnYzxU-gS4sZEeFv_E8CGBQNazvimaKtvkg_BVAe1inST51P_USDflm7WPvBVCUI5nUlW_gemfDxp4t7RW7ZAyz1LTek3HKtiRl1AlZaZqBki2zzggZUYfwEIPL_Fl-kiq05oFYmiFmBl8oVyzTRWh55Io0iSvyojq9gz_sGhN0XXaIeGyZXX4YnYXbf7tYScupKUOy1wY8KHGKkcSWSD7ykw5i2uKIyT7pmVV4WbJok6TseSjjKKYpkFL_FVyMerRERwaY9xsTNaNM5i9gyw' \
    -d 'client_id=iss-client&uid=114839'

Example Response

HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: text/plain;charset=UTF-8
X-Content-Type-Options: nosniff
X-XSS-Protection: 0
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY

Example Error Response

HTTP/1.1 400 Bad Request
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Cache-Control: no-store
Pragma: no-cache
X-Content-Type-Options: nosniff
X-XSS-Protection: 0
X-Frame-Options: DENY
Content-Length: 102

{
  "error" : "invalid_request",
  "error_description" : "sub or uid, and/or client_id is required."
}

Token Info

POST /oauth2/tinfo

Authorization

The client must pass its client_id and client_secret in the authorization header through Basic HTTP authorization via HEADER. The secret is Basic Base64Encode(client_id:client_secret).

Form Parameters

Parameter Optional Description

token

false

The token to look up.

token_type_hint

true

Token type hint.

Example Request

$ curl 'http://localhost:8080/oauth2/tinfo' -i -u 'client-id-token-info-pos:client_pw' -X POST \
    -d 'token=eyJraWQiOiIyNzE4MzgyMTM0MDE2NzEyMzAwOTE4IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiIxU09NRSNTVUJKRUNUMiIsImF1ZCI6ImNsaWVudC1pZC10b2tlbi1pbmZvLXBvcyIsInNjb3BlIjoib3BlbmlkIiwiZXhwIjoxNjkyNTg4MzE1LCJpYXQiOjE2OTI1ODMzMTUsInR0bCI6NTAwMCwianRpIjoidG9rZW4taWQtdG9rZW4taW5mby1wb3MifQ.DHcC0IgvdjG3OESr-eGfRtjhH4f4Zw2hYd_CkgrlmWqEuFd8FnNV-QIGCF8djK4fPlwFNjrUKaWZyG5tkJDNvQW0p9l4b-cW_sr_m0eW3c8sVpKyiQUfRfNafrp1ssLWhof4XZvekq3VejsRQvP3VU53aNBqL_IlFPad4W9NV43QsT3dbJOnD7FrY8Kkd2dlG1k0IHIOyHMJtr8XEzt4gOvuMn3DrLD-GPzBRp_FfV-uHY36mEx1dvPbFSPGH-Z2fkjXHgtAK6qTt7O8bGTrcAH0c9GvHDf1eSCP6ZrO5xB2PLEmFrDbLL1Yu7wS4zdv6KLybInsxOryQF2X5SEvxA'

Example Response

HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 151
X-Content-Type-Options: nosniff
X-XSS-Protection: 0
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY

{"sub":"1SOME#SUBJECT2","aud":"client-id-token-info-pos","scope":"openid","exp":1692588315,"iat":1692583315,"ttl":5000,"jti":"token-id-token-info-pos"}

Sample Expired Token

HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 22
X-Content-Type-Options: nosniff
X-XSS-Protection: 0
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY

{
  "active" : false
}

User Info

GET /oidc/uinfo

OpenID Connect UserInfo endpoint The parameters are those supported by the AWS Cognito USERINFO endpoint as this endpoint simply proxies to the AWS endpoint.

Authorization

Bearer <access_token>. Pass the access token using the authorization header field.

Example Request

$ curl 'http://localhost:8080/oidc/uinfo' -i -X GET \
    -H 'Authorization: Bearer eyJraWQiOiIyNzE4MzgyMTM0MDE2NzEyMzAwOTE4IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJtY2t4QWlUZHNBa3hNZWciLCJhdWQiOiJzb21lYm9keSIsInNjb3BlIjpbIm9wZW5pZCIsImVtYWlsIiwibmFtZSIsImwiXSwiaXNzIjoic29tZWJvZHkiLCJpZF90b2tlbiI6IkNZVXRNa3NPbE9sTktDeGxmRE1sT2UyVCIsImFjdGl2ZSI6dHJ1ZSwiZXhwIjoxNjkyNTgzMzMyLCJpYXQiOjE2OTI1ODMzMDIsInR0bCI6MzAsImp0aSI6IkJPQkFDQ0VTU1RPS0VOMDk0NTdER0QifQ.MNI02ssMIhOK6CUI1Nym5bUcx_uJQWofD08TkjXEZTgEkRUVnB4tnBKoelGIH6g5II8h-hc3eIKSgX1_Q_lgAaliaL3wwXGy0smMHBVJdRtQOP2Bs80ZZJIKY4tHyKGVTaTOrVMJ83AT9vu9zW8Ycjo9PNQ7jlJI2ffDdKwLmIxueZEBoK6Llq2O9rX0Y5f8aTDMBzkY3tUqb93ObmQXKTcMG0xmV-lqhKsITCjL0nFLhWZaCc1YbbzEx_pRU7mmMQ1jp9puKyU9J1eH50ThVARZkfecMVZjFZy3PqVlE63ezuJT9wy_qsSt6Ws4Gkin-4QJmq5GIORnk5SG7keTqQ'

Example Response

HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 0
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 220

{"sub":"mckxAiTdsAkxMeg","aud":"somebody","scope":[],"iss":"somebody","name":"Bob Bobberann","active":true,"exp":1692583332,"l":"Bobsville","iat":1692583302,"ttl":30,"jti":"CYUtMksOlOlNKCxlfDMlOe2T","email":"bob@vt.edu"}

Example Error Response

HTTP/1.1 403 Forbidden
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
WWW-Authenticate: Bearer error="insufficient_scope", error_description="The request requires higher privileges than provided by the access token.", error_uri="https://tools.ietf.org/html/rfc6750#section-3.1"
X-Content-Type-Options: nosniff
X-XSS-Protection: 0
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY

Known Compatibility Issues

  1. Spring Security < 5.2.0.RELEASE does not handle the JWK response correctly and will cause token exchange to fail. Use version 5.2.0 or greater, if at all possible. If that is not an option, you may have to write a custom NimbusAuthorizationCodeTokenResponseClient to handle the tokenResponse correctly.