Token & Session Management
Zanthem Identity Services provides endpoints for managing authentication sessions and issued tokens.
Applications are responsible for managing their own local application sessions in coordination with the central authentication session.
Session Types
| Session Type | Description |
|---|---|
| Authentication session | Central session maintained by Zanthem Identity Services. |
| Application session | Session maintained by the integrated application. |
| Access token lifetime | Period during which an issued access token is valid. |
| Refresh token lifetime | Period during which a refresh token may remain usable, subject to session policies. |
These lifetimes may differ depending on the configuration of the assigned application.
User Logout
Applications can initiate central authentication logout using the end-session endpoint.
Endpoint
GET or POST
https://auth.zanthem.cloud/realms/{realm}/protocol/openid-connect/logout
For browser-based applications, redirect the user to the end-session endpoint using the appropriate logout parameters.
Request Parameters
| Parameter | Description |
|---|---|
id_token_hint | Previously issued ID token identifying the authentication session. |
post_logout_redirect_uri | Approved destination following logout. |
client_id | Application client identifier, where applicable. |
state | Optional value used to correlate the logout response. |
When a post-logout redirect URI is supplied,
either id_token_hint or client_id must also
be provided.
Using a valid ID token hint is recommended.
Example Logout Request
https://auth.zanthem.cloud/realms/example-company/protocol/openid-connect/logout
?id_token_hint=ID_TOKEN
&post_logout_redirect_uri=https%3A%2F%2Fapp.example.com%2F
&state=GENERATED_LOGOUT_STATE
The request is displayed across multiple lines for readability.
All query parameters must be correctly URL encoded.
Application Logout Requirements
When initiating logout, applications should:
- Prepare any required logout parameters.
- Invalidate their local application session.
- Clear locally retained authentication credentials.
- Redirect the user to the end-session endpoint.
- Validate returned logout state, where supplied.
Post-logout redirect URIs must be approved and registered for the application client.
Contact your account manager to modify approved logout destinations.
Single Sign-Out
When applications share a central authentication session, terminating that session may affect other applications associated with the same session.
Complete single sign-out requires participating applications to properly handle logout notifications, session invalidation, or subsequent authentication failures.
Front-channel and back-channel logout may be configured where supported by the integrated application.
Contact your account manager to discuss single sign-out requirements.
Token Introspection
The introspection endpoint allows authorized confidential clients to determine the active status of a token.
Endpoint
POST
https://auth.zanthem.cloud/realms/{realm}/protocol/openid-connect/token/introspect
Authentication
Client authentication is required.
This endpoint must be accessed from a trusted server-side environment using an approved confidential client.
Request Parameters
| Parameter | Required | Description |
|---|---|---|
token | Yes | Token to inspect. |
token_type_hint | No | Optional indication of the token type. |
Example Request
curl --request POST \
"https://auth.zanthem.cloud/realms/example-company/protocol/openid-connect/token/introspect" \
--header "Content-Type: application/x-www-form-urlencoded" \
--user "${CLIENT_ID}:${CLIENT_SECRET}" \
--data-urlencode "token=${ACCESS_TOKEN}" \
--data-urlencode "token_type_hint=access_token"
Active Token Response
{
"active": true,
"client_id": "example-app",
"sub": "2d9174cc-4c53-4b39-8e35-8b6c34a80f24",
"scope": "openid profile email",
"exp": 1900000300
}
Inactive Token Response
{
"active": false
}
Additional response claims may be returned depending on the token and client configuration.
An active token response does not replace application authorization checks. Applications must still verify that the token is appropriate for the requested resource.
Token Revocation
The revocation endpoint allows applications to request invalidation of previously issued tokens.
Endpoint
POST
https://auth.zanthem.cloud/realms/{realm}/protocol/openid-connect/revoke
Request Parameters
| Parameter | Required | Description |
|---|---|---|
token | Yes | Token to revoke. |
token_type_hint | No | Optional token type indication. |
client_id | Conditional | Client identifier when not supplied through client authentication. |
Confidential clients must authenticate using their approved client authentication method.
Confidential Client Example
curl --request POST \
"https://auth.zanthem.cloud/realms/example-company/protocol/openid-connect/revoke" \
--header "Content-Type: application/x-www-form-urlencoded" \
--user "${CLIENT_ID}:${CLIENT_SECRET}" \
--data-urlencode "token=${REFRESH_TOKEN}" \
--data-urlencode "token_type_hint=refresh_token"
Public Client Example
curl --request POST \
"https://auth.zanthem.cloud/realms/example-company/protocol/openid-connect/revoke" \
--header "Content-Type: application/x-www-form-urlencoded" \
--data-urlencode "client_id=example-app" \
--data-urlencode "token=${REFRESH_TOKEN}" \
--data-urlencode "token_type_hint=refresh_token"
Successful Response
HTTP/1.1 200 OK
A successful revocation response does not necessarily indicate that the submitted token was previously active.
Token Revocation vs. Logout
Token revocation and user logout serve different purposes.
| Operation | Purpose |
|---|---|
| Local application logout | Terminates the application's local session. |
| Central logout | Terminates the central authentication session. |
| Token revocation | Invalidates a submitted token according to configured policies. |
| Token introspection | Checks the active status of a submitted token. |
Applications should use the appropriate operation based on their security and session requirements.
:::warning Access token expiration
Resource servers that validate JWT access tokens locally may continue accepting previously issued tokens until they expire.
Immediate enforcement of revocation requires an appropriate session-aware validation or revocation mechanism.
Do not assume that logout instantly invalidates every previously issued access token across all integrated applications.
:::
Session Expiration
Applications must handle session and token expiration without assuming fixed service-wide lifetime values.
Recommended application behavior includes:
- Track access token expiration.
- Refresh access tokens when appropriate.
- Replace rotated refresh tokens.
- Avoid concurrent refresh requests for the same session.
- Clear invalid authentication state.
- Initiate authentication when session recovery is not possible.
Suspected Credential Compromise
If credentials or tokens are suspected to have been compromised:
- Invalidate affected application sessions where possible.
- Revoke affected tokens where supported.
- Prevent further use of exposed credentials.
- Contact your Zanthem account manager immediately.
- Coordinate credential rotation and further remediation.