org.keycloak.models.sessions.infinispan

## Class InfinispanTokenRevocationStoreProvider

- java.lang.Object
- - org.keycloak.models.sessions.infinispan.InfinispanTokenRevocationStoreProvider

- All Implemented Interfaces:
    TokenRevocationStoreProvider, Provider

      public class InfinispanTokenRevocationStoreProvider
      extends Object
      implements TokenRevocationStoreProvider

  Author:
    Marek Posolda

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static org.jboss.logging.Logger` | `logger`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `InfinispanTokenRevocationStoreProvider(KeycloakSession session, Supplier<org.infinispan.commons.api.BasicCache<String,ActionTokenValueEntity>> tokenCache)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()`
    `boolean` | `isRevoked(String tokenId)`
    `void` | `putRevokedToken(String tokenId, long lifespanSeconds)` Mark given token as revoked.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### logger

          public static final org.jboss.logging.Logger logger

  - ### Constructor Detail

    - #### InfinispanTokenRevocationStoreProvider

          public InfinispanTokenRevocationStoreProvider(KeycloakSession session,
                                                        Supplier<org.infinispan.commons.api.BasicCache<String,ActionTokenValueEntity>> tokenCache)

  - ### Method Detail

    - #### putRevokedToken

          public void putRevokedToken(String tokenId,
                                      long lifespanSeconds)

      Description copied from interface: `TokenRevocationStoreProvider`
      Mark given token as revoked. Parameter "lifespanSeconds" is the time for which the token is considered revoked. After this time, it may be removed from this store, which means that `TokenRevocationStoreProvider.isRevoked(java.lang.String)` method will return false. In reality, the token will usually still be invalid due the "expiration" claim on it, however that is out of scope of this provider.
      Specified by:
        `putRevokedToken` in interface `TokenRevocationStoreProvider`

    - #### isRevoked

          public boolean isRevoked(String tokenId)

      Specified by:
        `isRevoked` in interface `TokenRevocationStoreProvider`
      Returns:
        true if token exists in the store, which indicates that it is revoked.

    - #### close

          public void close()

      Specified by:
        `close` in interface `Provider`

Copyright © 2020 JBoss by Red Hat. All rights reserved.