Package org.keycloak.models
Interface RevokedTokenProvider
- All Superinterfaces:
Provider
- All Known Implementing Classes:
InfinispanRevokedTokenProvider,JpaRevokedTokenProvider
Manages revoked tokens.
When a token is revoked (e.g. via logout or token revocation endpoint), its ID is stored so that subsequent validation attempts can reject it for the remainder of its natural lifespan. Expired entries are cleaned up automatically.
Obtain an instance via KeycloakSession.revokedTokens().
-
Method Summary
-
Method Details
-
put
Records a token as revoked.- Parameters:
id- the unique identifier of the token (typically itsjticlaim).lifespanSeconds- the remaining lifespan of the token in seconds. The revocation entry will be kept for at least this long to prevent the token from being accepted during its remaining validity.- Returns:
trueif the token was newly revoked;falseif it was already revoked.
-
contains
Checks whether a token has been revoked.- Parameters:
id- the unique identifier of the token (typically itsjticlaim).- Returns:
trueif the token is currently revoked;falseotherwise.
-