Class CookieTokenLoginSuccessHandler<A extends TokenAuthentication,B extends ExchangeContext,C extends Exchange<B>>

java.lang.Object
io.inverno.mod.security.http.token.CookieTokenLoginSuccessHandler<A,B,C>
Type Parameters:
A - the authentication type
B - the context type
C - the exchange type
All Implemented Interfaces:
LoginSuccessHandler<A,B,C>

public class CookieTokenLoginSuccessHandler<A extends TokenAuthentication,B extends ExchangeContext,C extends Exchange<B>> extends Object implements LoginSuccessHandler<A,B,C>

A login success handler that sets a token cookie in the response using the token value specified in the token authentication resulting from the login authentication.

The secure flag is set on the token cookie when the server is configured with TLS (HTTPS). An application deployed behind an SSL offloader is likely to be configured without TLS and as a result it is up to the SSL offloader to set the secure flag on the authentication token cookie.

Since:
1.5
Author:
Jeremy Kuhn
See Also:
  • Field Details

  • Constructor Details

    • CookieTokenLoginSuccessHandler

      public CookieTokenLoginSuccessHandler()

      Creates a cookie token login success handler with default path and token cookie name.

    • CookieTokenLoginSuccessHandler

      public CookieTokenLoginSuccessHandler(String path)

      Creates a cookie token login success handler with the specified path and the default token cookie name.

      Parameters:
      path - the token cookie path
    • CookieTokenLoginSuccessHandler

      public CookieTokenLoginSuccessHandler(String path, String tokenCookie)

      Creates a cookie token login success handler with specified path and token cookie name.

      Parameters:
      path - the token cookie path
      tokenCookie - the token cookie name
  • Method Details

    • getPath

      public String getPath()

      Returns the token cookie path.

      Returns:
      the token cookie path
    • getTokenCookie

      public String getTokenCookie()

      Returns the token cookie name.

      Returns:
      the token cookie name
    • handleLoginSuccess

      public Mono<Void> handleLoginSuccess(C exchange, A authentication)
      Description copied from interface: LoginSuccessHandler

      Handles successful authentication.

      Specified by:
      handleLoginSuccess in interface LoginSuccessHandler<A extends TokenAuthentication,B extends ExchangeContext,C extends Exchange<B>>
      Parameters:
      exchange - the exchange
      authentication - the authentication resulting from the authentication process
      Returns:
      a mono which completes when the authentication has been handled