org.keycloak.adapters

## Interface AdapterTokenStore

- All Known Implementing Classes:
    CatalinaCookieTokenStore, CatalinaCookieTokenStore, CatalinaSessionTokenStore, CatalinaSessionTokenStore, ServletSessionTokenStore, UndertowCookieTokenStore, UndertowSessionTokenStore

      public interface AdapterTokenStore

  Abstraction for storing token info on adapter side. Intended to be per-request object
  Author:
    Marek Posolda

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `checkCurrentToken()` Impl can validate if current token exists and perform refreshing if it exists and is expired
    `boolean` | `isCached(RequestAuthenticator authenticator)` Check if we are logged already (we have already valid and successfully refreshed accessToken).
    `void` | `logout()` Handle logout on store side and possibly propagate logout call to Keycloak
    `void` | `refreshCallback(RefreshableKeycloakSecurityContext securityContext)` Callback invoked after successful token refresh
    `void` | `saveAccountInfo(KeycloakAccount account)` Finish successful OAuth2 login and store validated account

- - ### Method Detail

    - #### checkCurrentToken

          void checkCurrentToken()

      Impl can validate if current token exists and perform refreshing if it exists and is expired

    - #### isCached

          boolean isCached(RequestAuthenticator authenticator)

      Check if we are logged already (we have already valid and successfully refreshed accessToken). Establish security context if yes
      Parameters:
        `authenticator` - used for actual request authentication
      Returns:
        true if we are logged-in already

    - #### saveAccountInfo

          void saveAccountInfo(KeycloakAccount account)

      Finish successful OAuth2 login and store validated account
      Parameters:
        `account` -

    - #### logout

          void logout()

      Handle logout on store side and possibly propagate logout call to Keycloak

    - #### refreshCallback

          void refreshCallback(RefreshableKeycloakSecurityContext securityContext)

      Callback invoked after successful token refresh
      Parameters:
        `securityContext` - context where refresh was performed

Copyright © 2014. All Rights Reserved.