Interface JWTSessionStore<A,B>

Type Parameters:
A - the session data type
B - the stateless session data type
All Superinterfaces:
SessionStore<A,JWTSession<A,B>>
All Known Implementing Classes:
InMemoryJWTSessionStore, RedisJWTSessionStore

public interface JWTSessionStore<A,B> extends SessionStore<A,JWTSession<A,B>>

A session store that uses JWT session identifier to store session expiration setting and stateless session data on the frontend.

Implementors should use JWT token identifiers (i.e. JTI) to identify sessions in the underlying data store.

Since:
1.13
Author:
Jeremy Kuhn
  • Method Details

    • getDataByTokenId

      Mono<A> getDataByTokenId(String tokenId)

      Returns the data of the session identified by the specified JWT token identifier (i.e. JTI).

      Parameters:
      tokenId - the JWT token identifier extracted from the JWT session id claims set
      Returns:
      a mono emitting the session data or an empty mono if no session exists with specified identifier or if a session exists which does not define any data
    • moveByTokenId

      Mono<Void> moveByTokenId(String tokenId, JOSEObject<JWTClaimsSet,?> newSessionJWT) throws IllegalStateException

      Moves the session identified by the specified JWT token identifier to the specified JWT session identifier.

      Parameters:
      tokenId - a JWT token identifier
      newSessionJWT - a new JWT session identifier
      Returns:
      a mono for moving a session
      Throws:
      IllegalStateException - if there is no session with the specified identifier or if a session already exists at the specified new identifier
    • removeByTokenId

      Mono<Void> removeByTokenId(String tokenId)

      Removes the session identified by the specified JWT token identifier (i.e. JTI).

      Parameters:
      tokenId - the JWT token identifier extracted from the JWT session id claims set
      Returns:
      a mono for removing a session