POST /token
Exchange credentials for a JWT access token.Request
The type of grant being requested. Determines which authentication flow is used.Supported values:
authorization_code- Exchange authorization code for token (standard OAuth 2.0)vp_token- Direct VP token exchange (OIDC4VP extension)urn:ietf:params:oauth:grant-type:token-exchange- Token exchange flow (RFC 8693)
Authorization Code Flow
The authorization code received from the authentication response.Example:
IwMTgvY3JlZGVudGlhbHMvMust match the redirect URI provided in the original authorization request.Format: URIExample:
https://my-portal.com/auth_callbackVP Token Flow
The verifiable presentation token containing verified credentials. Used when
grant_type is vp_token.Can be either:- JSON-LD Verifiable Presentation (Base64-URL encoded)
- SD-JWT VC format
Space-delimited list of requested scopes for the access token. If not provided, the default scope for the client is used.Example:
openid tir_read tir_writeToken Exchange Flow
A security token representing the identity of the party. For OIDC4VP, this contains the VP token.Required when
grant_type is urn:ietf:params:oauth:grant-type:token-exchange.An identifier indicating the type of security token in the
subject_token parameter.Supported value: urn:eu:oidf:vp_tokenA URI indicating the target service or resource where the client intends to use the token.If not provided as a path parameter (e.g.,
/services/{service_id}/token), this field is required.Format: URIExample: https://api.example.org/serviceThe logical name of the target service where the client intends to use the token.Example:
packet-delivery-serviceAn identifier for the type of requested security token.Supported value:
urn:ietf:params:oauth:token-type:access_tokenResponse
The type of token returned. Always
Bearer for this implementation.The JWT access token containing the verified credential claims.The token is signed using the verifier’s private key and can be verified using the public keys from the
/.well-known/jwks endpoint.Token lifetime in seconds.Example:
3600 (1 hour)The type of token that was issued. Present for token exchange flows.Value:
urn:ietf:params:oauth:token-type:access_tokenThe scopes associated with the issued token. Present for VP token and token exchange flows.Example:
openid tir_readExamples
Authorization Code Flow
200 OK
VP Token Direct Exchange
200 OK
Token Exchange Flow (RFC 8693)
200 OK
Service-Specific Token Endpoint
POST /services//token
Service-specific version of the token endpoint. The service context is provided via the path parameter instead of the request body.The identifier of the client/service requesting the token. This determines the scope and trust configuration.Example:
packet-delivery-portal/token endpoint.
Example
JWT Access Token Structure
The issued JWT access token contains the verified credential data and can be used for authorization in downstream services.Token Header
The signing algorithm used. Configured via
keyAlgorithm setting.Supported algorithms: RS256, ES256Default: RS256Key identifier for the signing key. Used to retrieve the public key from the JWKS endpoint.
Token type. Always
JWT.Token Payload
The issuer of the JWT (the verifier instance).
The subject of the token (holder DID from the credential).
The intended audience for the token.
Token expiration time (Unix timestamp).
The first verified credential from the presentation. Contains the full credential data including the credential subject and all claims.
Current Limitation: When multiple credentials are submitted in the VP token, all are verified but only the first credential is included in the generated JWT. Future versions may support multiple credentials.
Error Responses
Brief error description.
Detailed error information.
Common Errors
400 - Missing Grant Type
400 - Unsupported Grant Type
400 - Missing Code
400 - Invalid Token Request
400 - Missing Resource
400 - Invalid Subject Token Type
403 - Verification Failed
Verifying the JWT Token
Downstream services can verify the JWT token using the verifier’s public keys:-
Retrieve Public Keys
-
Verify Signature
Use a JWT library to verify the token signature using the public key matching the
kidin the token header. -
Validate Claims
- Check
exp(expiration) - Verify
iss(issuer) - Validate
aud(audience) matches your service
- Check
Related Endpoints
- Authentication Response - Submit credentials
- JWKS Endpoint - Retrieve public keys for token verification
- OpenID Configuration - Get provider metadata