- Type Parameters:
A
- the session data typeB
- the stateless session data type
- All Superinterfaces:
SessionStore<A,
JWTSession<A, B>>
- All Known Implementing Classes:
InMemoryJWTSessionStore
,RedisJWTSessionStore
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 Summary
Modifier and TypeMethodDescriptiongetDataByTokenId
(String tokenId) Returns the data of the session identified by the specified JWT token identifier (i.e.moveByTokenId
(String tokenId, JOSEObject<JWTClaimsSet, ?> newSessionJWT) Moves the session identified by the specified JWT token identifier to the specified JWT session identifier.removeByTokenId
(String tokenId) Removes the session identified by the specified JWT token identifier (i.e.
-
Method Details
-
getDataByTokenId
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 IllegalStateExceptionMoves the session identified by the specified JWT token identifier to the specified JWT session identifier.
- Parameters:
tokenId
- a JWT token identifiernewSessionJWT
- 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
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
-