Interface JWTSessionContext<A,B>

Type Parameters:
A - the session data type
B - the stateless session data type
All Superinterfaces:
ExchangeContext, SessionContext<A,JWTSession<A,B>>
All Known Subinterfaces:
JWTSessionContext.Intercepted<A,B>, JWTSessionSecurityContext<A,B,C,D>, JWTSessionSecurityContext.Intercepted<A,B,C,D>

public interface JWTSessionContext<A,B> extends SessionContext<A,JWTSession<A,B>>

A session context for exposing basic sessions.

It basically fixes the session type to JWTSession in order to simplify configuration in an application that relies on JWT sessions to be able to use stateless session data.

Since:
1.13
Author:
Jeremy Kuhn
  • Method Details

    • getStatelessSessionData

      default Mono<B> getStatelessSessionData()

      Returns the stateless session data.

      This is a shortcut for context.getSession().flatMap(JWTSession::getStatelessData) and as a result a new session is created when if none is present.

      Returns:
      a mono emitting stateless session data or an empty mono if none exist in the session or if a new session was created
    • getStatelessSessionData

      default Mono<B> getStatelessSessionData(Supplier<B> supplier)

      Returns the stateless session data or creates them using the specified supplier if none exist in the session.

      Parameters:
      supplier - a stateless session data supplier
      Returns:
      a mono emitting stateless session data