Interface TokenStore

All Known Implementing Classes:
TokenStore.DefaultStorageTokenStore

public interface TokenStore

Pluggable persistence for an OidcClient's tokens. Implement this and pass to OidcClient.setTokenStore(TokenStore) when you want a custom strategy (e.g. cross-device sync, encrypted-at-rest with your own key, in-memory only). The default is TokenStore.DefaultStorageTokenStore, which serialises tokens to the standard Storage under a per-issuer key. For biometric-gated persistence on iOS / Android, use

invalid reference
SecureStorageTokenStore
.

All methods are asynchronous and may run network or biometric prompts on the calling thread.

Since:
8.0
  • Method Details

    • load

      Reads previously-saved tokens for key, or completes with null if nothing is stored.
    • save

      AsyncResource<Boolean> save(String key, OidcTokens tokens)
      Persists tokens under key. Implementations should overwrite any existing entry atomically.
    • clear

      Removes the entry for key. Completing with Boolean.FALSE means nothing was stored; completing with an error means the underlying store failed.