Class CookieTokenLoginSuccessHandler<A extends TokenAuthentication,B extends ExchangeContext,C extends Exchange<B>>
- Type Parameters:
A
- the authentication typeB
- the context typeC
- the exchange type
- All Implemented Interfaces:
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 Summary
-
Constructor Summary
ConstructorDescriptionCreates a cookie token login success handler with default path and token cookie name.Creates a cookie token login success handler with the specified path and the default token cookie name.CookieTokenLoginSuccessHandler
(String path, String tokenCookie) Creates a cookie token login success handler with specified path and token cookie name. -
Method Summary
Modifier and TypeMethodDescriptiongetPath()
Returns the token cookie path.Returns the token cookie name.handleLoginSuccess
(C exchange, A authentication) Handles successful authentication.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.inverno.mod.security.http.login.LoginSuccessHandler
andThen, compose
-
Field Details
-
DEFAULT_PATH
The default token cookie path:/
.This constant is also used in
CookieTokenLogoutSuccessHandler
.- See Also:
-
-
Constructor Details
-
CookieTokenLoginSuccessHandler
public CookieTokenLoginSuccessHandler()Creates a cookie token login success handler with default path and token cookie name.
-
CookieTokenLoginSuccessHandler
Creates a cookie token login success handler with the specified path and the default token cookie name.
- Parameters:
path
- the token cookie path
-
CookieTokenLoginSuccessHandler
Creates a cookie token login success handler with specified path and token cookie name.
- Parameters:
path
- the token cookie pathtokenCookie
- the token cookie name
-
-
Method Details
-
getPath
Returns the token cookie path.
- Returns:
- the token cookie path
-
getTokenCookie
Returns the token cookie name.
- Returns:
- the token cookie name
-
handleLoginSuccess
Description copied from interface:LoginSuccessHandler
Handles successful authentication.
- Specified by:
handleLoginSuccess
in interfaceLoginSuccessHandler<A extends TokenAuthentication,
B extends ExchangeContext, C extends Exchange<B>> - Parameters:
exchange
- the exchangeauthentication
- the authentication resulting from the authentication process- Returns:
- a mono which completes when the authentication has been handled
-