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=sCMCCW2B2gXiX3GzdKBr7S

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.eyJzdWIiOiJkNjViOWExNy1hYjUwLTQ4NDctYWM4Ny00YzM0Y2ZiY2Q2NGEiLCJhdWQiOiJqb2xlbmUiLCJzY29wZSI6WyJvcGVuaWQiLCJlbWFpbCIsIm5hbWUiXSwiaXNzIjoic29tZWJvZHkiLCJhY3RpdmUiOnRydWUsImV4cCI6MTcwNzc0ODkxNCwiaWF0IjoxNzA3NzQ1OTE0LCJ0dGwiOjMwMDAsImp0aSI6IlVaQlQzTkxCWVNNWTQzTEhEMzRHVlNLSEZYVktHU0dBTiJ9.RgPr6ZajeY9s_gPTz1n0EUvi3MJ7aeaMIpQB1Nsky_NJZxgZHt5djOlC6huOo9H75-QRUkEFHlMNckMbSJdlaGNRSqhTAgBPGRzHmXI4UXzYiAa5xHKo5WbQExQhB91Gi9bkogVs80mamcpuRSV8g74FLf7_Ek_6r10pZVNdvBdpAPtY9DbYlTOLPNbQOJrifaFQPsHk3vOLxusdMPjQkeZMEbCsnlUw_PySgexZbhCBLvnixpftv4EyRCqOx93NFRxIrWBkUpPBQPff4ENg9TiGVp2yOIaH_a_bvOwWPxAN4s32DKx2uV_TH7vm0BKaP8LC6ev-bdcTfN7zuzRPJg","refresh_token":"eyJraWQiOiIyNzE4MzgyMTM0MDE2NzEyMzAwOTE4IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJkNjViOWExNy1hYjUwLTQ4NDctYWM4Ny00YzM0Y2ZiY2Q2NGEiLCJhdWQiOiJqb2xlbmUiLCJzY29wZSI6WyJvcGVuaWQiLCJlbWFpbCIsIm5hbWUiXSwiaXNzIjoic29tZWJvZHkiLCJhY3RpdmUiOnRydWUsImV4cCI6MTcwNzc1MTkxNCwiaWF0IjoxNzA3NzQ1OTE0LCJ0dGwiOjYwMDAsImp0aSI6IlNBRUNMWlRYV0w3S1IyREtESDgzOEtESFQ2Tk1YVEJaM0lJNFJHREhIVjQzSVZBRiJ9.eOnJsEPqdALtCeycInmG8fpRWIgQTzoNVFV_3uo8UyupGC4rdbpaOjM_LByo524nWNGdTICzg7QvxmSs7qoZCRjXFe2uFc75Ym5wa2oS6wGCFlQrjqaGvJS2YMD54ZejIWrnBRID7uaCXJ7kq1vdLsrnuBaz68KSsnroDfVpTdZ-s_yLKOENPQno0_M62OcjnYT1ArgOR8mQCDgOsFKakmQKkTLlpyLbgmuSrLizslb3C6wgqehO0SLBesIOC4sffv_n_qgXcL6KWbYqPfrg49oetYeIuEaH1ZHyoSvOHM1HQIO9E4u4tG2KvByPZEpliAtCcpmfsWpMaaRz2pyMpw","id_token":"eyJraWQiOiIyNzE4MzgyMTM0MDE2NzEyMzAwOTE4IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJkNjViOWExNy1hYjUwLTQ4NDctYWM4Ny00YzM0Y2ZiY2Q2NGEiLCJpc3MiOiJzb21lYm9keSIsImFjdGl2ZSI6dHJ1ZSwidHRsIjozMDAwLCJub25jZSI6IkhES0QtOEg3JEhELUtESEE4TCIsImF1ZCI6ImpvbGVuZSIsInNjb3BlIjpbIm9wZW5pZCIsImVtYWlsIiwibmFtZSJdLCJuYW1lIjoiSm9sZW5lIEpvbGUiLCJleHAiOjE3MDc3NDg5MTQsImlhdCI6MTcwNzc0NTkxNCwianRpIjoiN0tSMlQyRUFYNlFCTFREODM4SERLRExEM0lWQUZTQUVDTFpUWFdMIiwiZW1haWwiOiJqb2xlbmVAdnQuZWR1In0.onYLtNrXd5SNdEBx9wg9tB8wuZc8jju5_MZ9M6z6NeLFMDssfX_Di_1fQ6B71uSkA66UmtEXC_sf-xHSfZpVnXwxTODy-t3eMZe4Uk_DduGggUeTkjfgGlBUrBIfj1RuhQH4ySPUHmYZfDEhaGPzVnfNWqMDLhEVYH-i6EoTuutjVlKP-EuL7Z9lKkX3eZLtopQDKh2wN4L6Qh697uEM4IWUSWBgCacbzLNE-dF7_cCfy3JkzdhJeLDNs1TtYvZUThnHecJjEwSAzEu3iB2brUXkU9qrukSZwhKMqEJT0bkMQ6vrJ4x9e3NXoBSXv9oLf5GSBjb1RWScSQZ-ALLAYg"}

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.eyJzdWIiOiI5M2M1MDVhMy03MDkzLTQ0OTYtYmI5OS1hZTNjOGIzN2Y0NDEiLCJhdWQiOiJyaG8iLCJzY29wZSI6WyJ0aGUtc2NvcGUiXSwiaXNzIjoic29tZWJvZHkiLCJhY3RpdmUiOnRydWUsImV4cCI6MTcwNzc1MTkxNCwiaWF0IjoxNzA3NzQ1OTE0LCJ0dGwiOjYwMDAsImp0aSI6IlZZTEpIT0FURVo2V1M0QjZRV1JVWERTN0dIUkpYNFdaUTdZSklVVlNKWloifQ.bDd7BifYMeCkLzXf6Psc890Gx5XKUGtgzYOUbhzvWOY5OIWvNPKY1aPjc6Y4dwi6h90SUbZ_Mz_rXRZ84eEL-feImQdDmMFa19f1Buc1g6DNYju5cyxDzysO3UHT0qcxlIPJwxvg9Rz0CiHp0lZKPpcLH9xclTeYrrKQV2mZm6fJ4SEnpZv2bvC7dMXbTKmvwy5bk9FRkBMaY_SJfb4WFfXcDU6pMtmzuR9-Wn6tl56Np1qmMxhzEfh3EB2SWNMFTROlJB0Fi9vd42IQJ0fqbWokYAlRvZSWZQ0TGBLKidcg4Q5-mPY4WFJQhqQXjemOSRWizsSl9qYDl7aQDDtnwQ&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.eyJzdWIiOiI5M2M1MDVhMy03MDkzLTQ0OTYtYmI5OS1hZTNjOGIzN2Y0NDEiLCJhdWQiOiJyaG8iLCJzY29wZSI6WyJ0aGUtc2NvcGUiXSwiaXNzIjoic29tZWJvZHkiLCJhY3RpdmUiOnRydWUsImV4cCI6MTcwNzc0ODkxNCwiaWF0IjoxNzA3NzQ1OTE0LCJ0dGwiOjMwMDAsImp0aSI6ImUzZmViZGQ1LWRkZjAtNGFkZC04YmY1LWNlYWQ2NmE3YTRjYyJ9.f-VcHxU-Yzda8-f_xIvyHuf_1FwpxpfVf8fiTNAxwjRhOd_dnGA4WbTppRm7UMFHDEw20Yv7e9Zakti2TS5mAwMacYW1VMw5ZKV8mGn_ZzNKFgKjWm4bskXWbuIqe_QcXsCiEKi6c8tN468CDwVYZv_A1JTNWYjMYxVeuyjmzNGkxBM7zJ4pG9c_LgdT5AFYe4hHe_WPtwp4tJMPnKN2Ajw_ghNfUPkR7ax-MQiofAJxlkP97y0Ew004sYqx7HqgTQAgphcgfLgqlBQj6bkFV2H7Hwk-DNv8UHhcd-yK9yzJwyNu3T1CXR_Gtlr89EZ01reFbRXFWYM0xwbKHPHfZg","refresh_token":"eyJraWQiOiIyNzE4MzgyMTM0MDE2NzEyMzAwOTE4IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiI5M2M1MDVhMy03MDkzLTQ0OTYtYmI5OS1hZTNjOGIzN2Y0NDEiLCJhdWQiOiJyaG8iLCJzY29wZSI6WyJ0aGUtc2NvcGUiXSwiaXNzIjoic29tZWJvZHkiLCJhY3RpdmUiOnRydWUsImV4cCI6MTcwNzgwNTkxNCwiaWF0IjoxNzA3NzQ1OTE0LCJ0dGwiOjYwMDAwLCJqdGkiOiJhNTAyNzI1Zi1mYjZlLTRjZDgtYWM2Zi1hYTMxNzliM2Q1MzgifQ.EdmI3mogg8dN16s9bgbeYqdCeUuzYYpz2OD4ha0QwW8Goset5PghA8wZ6squGJnoBoG4YnWJ3CTEyl2ZOXVPWYjRhginEg6ZvRn55xr7pgvXW_CWA2urvIjGrcVt5SPoodagL6JwvZLvo72EJPQ5FKw9-MBdImlJ_viqUgPJfE_ragatEW6sDB03-yMgt1x-aBUkOhXCCkhgfaiLpjVoUDeTOUFWjiNByfb0-1Jb0ZZFjLer9NnoPvgDQXXLoNW9U07yxhu_Tmbu9MPMQv3H8_dM_Y6YTOni9t5EXUmQG0gW6gUQifdAbgQZw7jwi79x_QQJbiuitHNzLJDEBpJ6RA"}

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.eyJzdWIiOiI0ZTk0NzYyZi0xNjZhLTQzM2YtOGQ0Yy0xNGQyZjIzMWQzYmUiLCJhdWQiOiIxMjM0NTY3OC05MGIwLTEwMDItYTBhMS1mZmJiYmI5MjNkZjAiLCJzY29wZSI6WyJjIl0sImlzcyI6InNvbWVib2R5IiwiYWN0aXZlIjp0cnVlLCJleHAiOjE3MDc3NDg5MTQsImlhdCI6MTcwNzc0NTkxNCwidHRsIjozMDAwLCJqdGkiOiI4ZjIxODRiMS1jOGYxLTQ0MDktOGFmNS1lOTA2Zjg1MGI1MDciLCJ1c2VybmFtZSI6InNpZ21hIn0.gIR4MHN3MJuItkQfZTl3whiwXzWL1G_WhLk5WEEkJQB2k-kOdJHh7oLP3j49Frj23SlcIOgyPaayUvAYYaCdDb8hRP3tQAamh2bqxlpTj22CmAwbig4KiWrpmf3frnDBZ_yDM6jCF4a0A3eUOX_IOL2i-ex74VE60CbqPgUgTZKpeWlukmJTBtYu6f1sic_l1fnhxWvguq4_YwvZmWbo8M8TOiX41gEkRzCOOvWJHKtvOmOZzNUVuJpcwuJ7EsLB94C6NI2cG6LL9Et7A0TJBxgl88HYgOLsKodFzccf8oWCHgSgphTLKN1zInoenfjzE_-I1S_xPX5ZTt2B8Es8Mg"}

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.eyJzdWIiOiJjbGllbnQtaWQtYSIsImF1ZCI6ImNsaWVudC1pZC1hIiwic2NvcGUiOiJvcGVuaWQiLCJleHAiOjE3MDc3NTA5MDgsImlhdCI6MTcwNzc0NTkwOCwidHRsIjo1MDAwLCJqdGkiOiJ0b2tlbi10by1yZXZva2UtaWQifQ.fNih4P8ZY7k6XKhma0PsEpewl9nM9iW9M0RNrRDH6fFheBPfLZlv_aOuakLiOdf6cpwDJallLyYo5_uGfBJ-As68-VNaID51i3V2taojqaqhSR-ZiOskmdEsd8Yz5ku5csQSzTc0D5zNRf9m0PUFsidVSSbm0bliVq3MRPeQ6j3jlHuWzqsuV0BbrNwUhJv2VfjKWUcLQKEumYvWsBWYwqMvzNADSbzZPwlLroAESsQ4iezGR9vkK3wXdPtg00Zpo366pat-BABxzFRNOTWKaplVg5YfE6ubDrVHdofUCy2K6OeWfScAg3lxmV4RE8SgSfFzWq3jd-AQWNqfcg1OMQ'

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.eyJzdWIiOiJqZGpka2FES0ZrZCIsImF1ZCI6InNvbWUtY2xpZW50Iiwic2NvcGUiOiJvcGVuaWQiLCJleHAiOjE3MDc3NTA5MDcsImlhdCI6MTcwNzc0NTkwNywidHRsIjo1MDAwLCJqdGkiOiJBTEtESERMS0RIS0Q5Njg3SkhLSCJ9.Q3L59kO7hXyL_yiDac06JMQxvGaPb9j39y1p243ekz1LUzdbyS5O5BwUIPeCNSBOYUVRxfdZIe87k17JkwIcUI1dQuLiNHvVAkghmvBuf608yPAoHIuitQSViNDjUkua2weTjTYFPPKqXE-wcBztzCdGmPhFb_K22n2YiRJeZNAvulnW-diBh_Y5ItjlQwNJIuwv0-Fp-3JXx2Llw2DtRQA8COcQqYRc0kTj8gEw3EjVlmMNwc-cfgjDH5HNWgAFpn-njvSy4naqppSAKoLd4Fh3-k1I_5KEK7WpMm88u7wgfMrYBs37FCuHbD5OhjJftAhVJKSKPOsgnZMfuJE6cg' \
    -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.eyJzdWIiOiJhZG1pbiIsImF1ZCI6ImFkbWluLWNsaWVudCIsInNjb3BlIjpbIm9wZW5pZCIsImdhdGV3YXk6b2F1dGgyL3Rva2Vucy9hZG1pbiJdLCJleHAiOjE3MDc3NTA5MDgsImlhdCI6MTcwNzc0NTkwOCwidHRsIjo1MDAwLCJqdGkiOiJBRE1JTjFVU0VSIn0.qrgPcKstd_L7fwZASSNf7j3P-GnIHmRM4lgotY6Vwmr65Egg8FwZCazl7z8apyXKpR1f0vQVmgP9LCdZCxmVCeWiAk7Im8hj8qYVsXcvncBOmRJxPR9XQb-r93NDwZHpkYorO4_ZcRcAK6z9kSzDrrJESm6i74ejNNQ--jFT9Yw56pw7WvCig4Egk5g8MB-H71XwrWQPINTI_N3W_J9l4Qu5UxZ1NFVxnIrb4eIfXjqQen0JTjOErsikVIwred0lYj5AiCd6gHB7bPiqUmwERy6m5fuWVa7q70Y_Q89PIVUxJQrIsWHdGX_eq2TMNp_t6zH6Nva2YHNPCe5agVf8kg' \
    -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.eyJzdWIiOiIxU09NRSNTVUJKRUNUMiIsImF1ZCI6ImNsaWVudC1pZC10b2tlbi1pbmZvLXBvcyIsInNjb3BlIjoib3BlbmlkIiwiZXhwIjoxNzA3NzUwOTE2LCJpYXQiOjE3MDc3NDU5MTYsInR0bCI6NTAwMCwianRpIjoidG9rZW4taWQtdG9rZW4taW5mby1wb3MifQ.sP8knckk6R4PG5Ju5hVA9ul9ikZUSOoLQRQ4Hr6JO7hRPTmJ-5-EH2vw1bQGllyC9Qz6tx4lHeSD90bL2iykSIkcFtkQPngFUZH6Su4Lk7dGKAx0oTw6-A7cAvtXJ9fSYT_M78lNMKl9w0Um_A1XeqbQlg7Ki_cExDObfj2C7b9d8VQSb65Rko69E8Dn_cYtHdcMTYKgz8FeqZoWdsfFlkax5bzGJO-N6miuGuSivyjM4ajJYNQhvclvC069UolxcFFIXBUyfE9zp-PWcb7dBiGoMcs0d5RRu4jThdF97UrcHYky9poF86rMJdk6PT-dibbH621d2LZUzl38AaAFFw'

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":1707750916,"iat":1707745916,"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.eyJzdWIiOiJtY2t4QWlUZHNBa3hNZWciLCJhdWQiOiJzb21lYm9keSIsInNjb3BlIjpbIm9wZW5pZCIsImVtYWlsIiwibmFtZSIsImwiXSwiaXNzIjoic29tZWJvZHkiLCJpZF90b2tlbiI6IkNZVXRNa3NPbE9sTktDeGxmRE1sT2UyVCIsImFjdGl2ZSI6dHJ1ZSwiZXhwIjoxNzA3NzQ1OTMyLCJpYXQiOjE3MDc3NDU5MDIsInR0bCI6MzAsImp0aSI6IkJPQkFDQ0VTU1RPS0VOMDk0NTdER0QifQ.gICbjhBQYUNVCpM7ccGSHiRdEgrjUGp9j-o4cNSPSur5KXFDiqRpFcGglNrQ2ozspC-9XcbktL0TwW6wb2cU3IJrk4HOeEYzVcJqGJaRWrTgsXON6fdMknCKwrQuzSuDdUFj91Um9phPxi6wzcJl2rHHkaBSK_9enRD-gzxTpJLZFUW93CuCiaojNiHPsERT0ZIve7pyMHQMp2LfubgdXPlgUVrUX9zLgytYRQuGbeTEelO3CBpxbwn7DUrmopHeoNfoS-KE8_HmQ-FAeSmrgFk2Qbiw7rIl_EBE9Xuj4xHb6rnIzwzAmu3L1ojvLDxSjcfaiIB2L6lVALSk4griUw'

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":1707745932,"l":"Bobsville","iat":1707745902,"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.