Interface TokenCredentialStore

All Known Subinterfaces:
ThreadSafeTokenCredentialStore
All Known Implementing Classes:
InMemoryTokenCredentialStore

@ExperimentalJSentinelApi("V00.74 token propagation; stable promotion staged for V00.76") public interface TokenCredentialStore
Persistence-neutral store for the current subject's TokenCredential. Inbound resolvers (V00.74 RestSubjectResolver extension, V00.80 OIDC bridge) populate it; outbound wrappers (@PropagateToken, PropagatingProxy) read from it.

Adapter-specific defaults ship in each adapter module:

  • VaadinSessionTokenCredentialStore (jSentinel-vaadin) — backed by VaadinSession.
  • ThreadLocalTokenCredentialStore (jSentinel-rest) — backed by a per-request ThreadLocal, scoped by RestTokenCredentialFilter.
  • ThreadLocalTokenCredentialStore (jSentinel-standalone) — backed by a per-thread ThreadLocal, scoped by StandaloneLoginFlow.

Consumers override the SPI default through the .propagation(p -> p.credentialStore(myStore)) sub-builder (V00.74 Prompt 015 / 016).

The V00.74 contract intentionally omits a refresh() surface — RefreshableTokenCredentialStore extends TokenCredentialStore is staged for V00.76 (Konzept §6.4) so adding it later does not break this contract.

Since:
00.74.00
  • Method Details

    • bind

      void bind(TokenCredential credential)
      Replace any current entry with credential.
      Parameters:
      credential - the new entry (non-null)
    • current

      Returns:
      the current entry, or empty
    • clear

      void clear()
      Reset to the empty state. Idempotent — repeated calls are no-ops.