Interface SingleUseTokenStoreProvider

  • All Superinterfaces:
    Provider
    All Known Implementing Classes:
    InfinispanSingleUseTokenStoreProvider

    public interface SingleUseTokenStoreProvider
    extends Provider
    Provides single-use cache for OAuth2 code parameter. Used to ensure that particular value of code parameter is used once. TODO: For now, it is separate provider as CodeToTokenStoreProvider, however will be good to merge those 2 providers to "SingleUseCacheProvider" in the future as they provide very similar thing
    Author:
    Marek Posolda
    • Method Detail

      • putIfAbsent

        boolean putIfAbsent​(String tokenId,
                            int lifespanInSeconds)
        Will try to put the token into the cache. It will success just if token is not already there.
        Parameters:
        tokenId -
        lifespanInSeconds - Minimum lifespan for which successfully added token will be kept in the cache.
        Returns:
        true if token was successfully put into the cache. This means that same token wasn't in the cache before