Token Introspection



The token introspection endpoint is used to introspect tokens. This is useful when the client requires opaque tokens that are not structured, such that protected resources can request the introspection endpoint and get information about the token. The endpoint supports introspecting access tokens and refresh tokens.


Table 1: Specifications
NameDescription
OpenId ConnectCore specification for OpenId Connect
Token IntrospectionSpecification for introspecting tokens
DPoPSpecification for sender constraining tokens using DPoP
Step up authenticationStep up authentication specification

The token introspection endpoint accepts the POST HTTP method, and the content is application/x-www-form-urlencoded.

The endpoint also requires client authentication, and the parameters are defined in the Client Authentication page.

The endpoint requires client authentication by confidential clients.

The token introspection endpoint returns HTTP 200 if successful, and 400 if an error occurred.

If the token does not exist, is revoked, expired then the token is deemed inactive. If the client is not authorized for any scope of the token, or if the client is not an audience of the token, then the token is deemed inactive.

The following table shows the parameters that can be sent to the endpoint.

Table 2: Token Introspection request parameters
NameDescription
tokenThe token to be introspected. It is required.
token_type_hintThe type of token to be introspected. It is optional.

Table 3: Token Introspection response parameters
NameDescription
activeBoolean determining if the token is active or not. This is required.
scopeSpace delimited string of scopes. This is required if active.
client_idId of client that owns the token. This is required if active.
usernameUsername of the token's subject. This is optional.
token_typeThe token's type, which is either Bearer or DPoP. This is required if active.
expUnix timestamp when the token expires. This is required if active.
iatUnix timestamp when the token was issued. This is required if active.
nbfUnix timestamp when the token is active from. This is required if active.
subSubject of the token. Either the end-user or the client. This is required if active.
audArray of URIs that may accept the token. This is required if active.
issURI of AuthServer. This is required if active.
jtiUnique identifier of the token. This is required if active.
auth_timeUnix timestamp of when the end-user authenticated. This is optional.
acrThe AuthenticationContextReference used when the end-user authenticated. This is optional.
cnfObject with one field, which is jkt. That is the thumbprint of the DPoP if the token is sender-constrained. This is optional.
access_controlObject with end-user claims used for authorization purposes. This is optional.

The following HTTP example shows a request to introspect an access token.

            
                
POST /connect/introspection HTTP/1.1
Host: idp.authserver.dk
Content-Type: application/x-www-form-urlencoded
Authorization: Basic czZCaGRSa3F0MzpnWDFmQmF0M2JW

token=23nthgnreag67n
        
            
        

The following HTTP example shows a response with an active dpop bound token and an end-user as the subject.

            
                
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Cache-Control: no-cache, no-store

{
  "active": true,
  "scope": "scope:read scope:write",
  "client_id": "35d7d4f0-27c8-463c-8057-d39953a16972",
  "username": "john",
  "token_type": "DPoP",
  "exp": 1751708358,
  "iat": 1751708058,
  "nbf": 1751708058,
  "sub": "ec14d771-d1bb-4d0c-9965-8243700a739f",
  "aud": [ "https://api.authserver.dk" ],
  "iss": "https://idp.authserver.dk",
  "jti": "ec26ea37-e612-45f7-8989-612554499117",
  "auth_time": 1751707358,
  "acr": "urn:authserver:loa:substantial",
  "cnf":
  {
    "jkt": "ZcOCORZNYy-DWpqq30jZyJGHTN0d2HglBV3uiguA4I"
  },
  "access_control":
  {
    "roles": [ "admin" ]
  }
}
        
            
        

The following HTTP example shows a response with an active bearer token and the client as the subject.

            
                
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Cache-Control: no-cache, no-store

{
  "active": true,
  "scope": "scope:read scope:write",
  "client_id": "35d7d4f0-27c8-463c-8057-d39953a16972",
  "token_type": "Bearer",
  "exp": 1751708358,
  "iat": 1751708058,
  "nbf": 1751708058,
  "sub": "35d7d4f0-27c8-463c-8057-d39953a16972",
  "aud": [ "https://api.authserver.dk" ],
  "iss": "https://idp.authserver.dk",
  "jti": "ec26ea37-e612-45f7-8989-612554499117"
}
        
            
        

The following HTTP example shows a response with an inactive token.

            
                
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Cache-Control: no-cache, no-store

{
  "active": false
}