Token revocation
Overview
Token revocation lets your application explicitly invalidate a refresh or access token before it expires, via the RFC 7009 revocation endpoint.
Token revocation allows your application to explicitly invalidate a token before it expires. The LuxID revocation endpoint implements RFC 7009 - OAuth 2.0 Token Revocation (opens in a new tab).
Endpoint:
https://login.luxid.lu/mga/sps/oauth/oauth20/revoke
Method: POST
Client authentication is required. The endpoint accepts both refresh tokens and access tokens.
When to revoke tokens
Revocation is appropriate in the following situations:
- User-initiated logout from your application: revoke the refresh token so the user's session cannot be silently renewed after they leave.
- Security incident: if you suspect a token has been compromised (for example, leaked in logs or intercepted), revoke it immediately.
- Account suspension or offboarding: if your application revokes access for a user, revoke their refresh token to prevent further silent renewals.
- Subscription changes: if your integration triggers a LuxID Subscription revoke (via the Partner API), revoke the associated tokens as well to enforce the change immediately.
- Device or session management: if your application maintains a list of active devices or sessions, revocation should accompany removal.
LuxID revocation behaviour
Revoking a Refresh Token
Revoking a refresh token:
- Immediately invalidates the refresh token itself.
- Invalidates all access tokens that were derived from that refresh token.
- Prevents silent renewal - the next call to the Token endpoint with that refresh token returns an error.
This is the most effective form of revocation for ending a user's session in your application.
Revoking an Access Token
Revoking an access token:
- Marks the access token as revoked in LuxID.
- Has limited practical effect for JWT access tokens because resource servers that validate JWT signatures locally will not be aware of the revocation until the token expires. The revocation is reflected in introspection responses.
- Does not invalidate the refresh token or other access tokens derived from the same refresh token.
Revoking access tokens is useful when you want to force re-introspection on your resource servers, or when tokens are opaque rather than JWT-based.
Always revoke the refresh token when implementing logout or incident response. Revoking only the access token leaves the refresh token active.
Client authentication
All revocation requests must be authenticated. LuxID supports the same client authentication methods as the Token endpoint:
| Method | How to supply |
|---|---|
client_secret_basic | Authorization: Basic base64(client_id:client_secret) |
client_secret_post | client_id and client_secret in the POST body |
See Client credentials for your application's configured method.
Request
POST /mga/sps/oauth/oauth20/revoke HTTP/1.1
Host: login.luxid.lu
Content-Type: application/x-www-form-urlencoded
Authorization: Basic base64(client_id:client_secret)
token=<refresh_or_access_token>&token_type_hint=refresh_token
Request parameters
| Parameter | Required | Description |
|---|---|---|
token | Yes | The token to revoke |
token_type_hint | No | refresh_token or access_token - helps the server find the token faster |
cURL examples
Revoking a Refresh Token
curl -s \
-X POST \
-H "Content-Type: application/x-www-form-urlencoded" \
-u "your_client_id:your_client_secret" \
-d "token=dGhpcyBpcyBhIHJlZnJlc2ggdG9rZW4...&token_type_hint=refresh_token" \
https://login.luxid.lu/mga/sps/oauth/oauth20/revoke
Revoking an Access Token
curl -s \
-X POST \
-H "Content-Type: application/x-www-form-urlencoded" \
-u "your_client_id:your_client_secret" \
-d "token=eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...&token_type_hint=access_token" \
https://login.luxid.lu/mga/sps/oauth/oauth20/revoke
Using client_secret_post
curl -s \
-X POST \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "token=dGhpcyBpcyBhIHJlZnJlc2ggdG9rZW4..." \
-d "token_type_hint=refresh_token" \
-d "client_id=your_client_id" \
-d "client_secret=your_client_secret" \
https://login.luxid.lu/mga/sps/oauth/oauth20/revoke
Response
Success
HTTP/1.1 200 OK
Per RFC 7009 §2.2, a successful revocation always returns 200 OK with an empty body. This is true even if the token did not exist or was already expired - the server does not reveal whether the token was valid.
Error responses
401 unauthorized - client authentication failed
{
"error": "invalid_client",
"error_description": "Client authentication failed"
}
Resolution: verify your client_id and client_secret. Confirm the authentication method matches what is configured in the Console.
400 bad request - unsupported token type
{
"error": "unsupported_token_type",
"error_description": "The token type is not supported for revocation"
}
Resolution: supply a refresh_token or access_token. ID tokens cannot be revoked via this endpoint.
400 bad request - missing token
{
"error": "invalid_request",
"error_description": "The request is missing the required parameter: token"
}
Logout flow
A complete application logout involves several steps beyond token revocation. The recommended sequence is:
After revoking the refresh token:
- Clear all session state in your application (session cookie, stored tokens, user state).
- Token revocation invalidates this Application's tokens for this user - it does not terminate the user's LuxID session. The user remains signed in to LuxID at
login.luxid.luand may still be silently re-authenticated by other LuxID Partners. If the user explicitly wants to end the LuxID session, redirect them tohttps://login.luxid.lu/auth/logout?client_id=<your-client-id>(LuxID does not expose an OIDCend_session_endpoint). See Session management and Single Sign-On.
Revocation and the LuxID data model
A LuxID Subscription represents the ongoing relationship between a user and your application. Token revocation operates at the token layer; Subscription revocation operates at the data layer:
| Action | Tokens | Subscription | User data |
|---|---|---|---|
| Revoke refresh token | Invalidated | Still active | Unchanged |
| Revoke access token | Invalidated | Still active | Unchanged |
| Revoke Subscription (via Partner API) | All tokens invalidated | Terminated | Consent withdrawn |
Token revocation alone does not terminate the Subscription or withdraw consent. The user will be asked to consent again on the next sign-in flow. Subscription revocation (via the Partner API) terminates the relationship entirely.
Integration checklist
- Always revoke the refresh token (not just the access token) when the user logs out of your application.
- Clear local session state (cookies, storage) after revoking, before redirecting.
- Handle
200 OKidempotently - do not treat it as confirmation that the token was previously valid. - A
subscription.revokedevent to detect user-initiated revocation is planned for the Event Hub (not emitted today, which emits onlyClaimValuesChanged); until it ships, detect revocation from theinvalid_grantreturned on the next token call. - For security incidents, revoke the refresh token immediately and consider triggering a full re-authentication flow.
- Do not attempt to revoke ID tokens - they are not accepted by the revocation endpoint.
Related pages
- Session management - session lifecycle and user-driven LuxID sign-out
- Token introspection - verifying token state after revocation
- Webhooks and events API - the planned subscription.revoked event
- Single Sign-On - SSO logout considerations
- Advanced security options - PAR and JAR (not currently implemented)
- OAuth and OIDC error codes - error reference