Token Introspection

Token Introspection

Endpoint:
POST /relid/authserver/oauth/introspect

Description:
Allows clients to verify the validity and metadata of an access or refresh token. This is useful to confirm if a token is active and obtain information such as scopes, expiry, and user ID.


🔐 Authentication

Type: Basic Auth
Header Format: Authorization: Basic <base64(client_id:client_secret)>


📥 Request Headers

HeaderValue
AuthorizationBasic authentication credentials
Content-Typeapplication/x-www-form-urlencoded
Acceptapplication/json

📤 Request Body (Form URL Encoded)

FieldTypeRequiredDescription
tokenstringYesThe token to be introspected
token_type_hintstringNoHint about the type of token (access_token or refresh_token)

📥 Query Parameters

No query parameters.


📬 Response Fields

FieldTypeDescription
activebooleanIndicates if the token is currently active
scopestringSpace-separated list of scopes associated with the token
client_idstringClient ID the token was issued to
usernamestringUser ID tied to the token
expnumberExpiry time (Unix timestamp)
substringSubject of the token
audarrayAudience for the token
nbfnumberNot valid before this timestamp
jtistringJWT ID
issstringIssuer of the token
iatnumberIssued at (Unix timestamp)
token_typestringType of the token (e.g., Bearer)

📘 Example Request (cURL)

curl 'https://auth.relid.com:8006/relid/authserver/oauth/introspect' \
  -u '<client_id>:<client_secret>' \
  -X POST \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -H 'Accept: application/json' \
  -d 'token=<access_token>&token_type_hint=access_token'

📘 Example Response

{
  "active": true,
  "sub": "ZDcyOTY1YjgtYjhlZS00ZDAyLWE5NjUtYjhiOGVlY2QwMjA1",
  "aud": ["gm-api-server", "idv-web-server", "OIDC"],
  "nbf": 1726050259,
  "scope": "all",
  "iss": "https://auth.relid.com",
  "exp": 1726053859,
  "iat": 1726050259,
  "jti": "66b5c480-ffea-4861-9b15-f589ba7e9d03",
  "client_id": "ZDcyOTY1YjgtYjhlZS00ZDAyLWE5NjUtYjhiOGVlY2QwMjA1",
  "username": "ZDcyOTY1YjgtYjhlZS00ZDAyLWE5NjUtYjhiOGVlY2QwMjA1",
  "token_type": "Bearer"
}

📝 Notes

  • Only tokens issued by this AuthServer are supported.
  • This is especially useful when tokens are passed between services for authorization.
  • NOTE: Request parameters must be provided in the request body, not the URL.