Search in sources :

Example 1 with TokenRevocationStoreProvider

use of org.keycloak.models.TokenRevocationStoreProvider in project keycloak by keycloak.

the class TokenRevocationEndpoint method revokeAccessToken.

private void revokeAccessToken() {
    TokenRevocationStoreProvider revocationStore = session.getProvider(TokenRevocationStoreProvider.class);
    int currentTime = Time.currentTime();
    long lifespanInSecs = Math.max(token.getExp() - currentTime, 10);
    revocationStore.putRevokedToken(token.getId(), lifespanInSecs);
}
Also used : TokenRevocationStoreProvider(org.keycloak.models.TokenRevocationStoreProvider)

Aggregations

TokenRevocationStoreProvider (org.keycloak.models.TokenRevocationStoreProvider)1