Class TokenCookieLoginHandler
java.lang.Object
io.micronaut.security.token.cookie.CookieLoginHandler
io.micronaut.security.token.cookie.TokenCookieLoginHandler
- All Implemented Interfaces:
LoginHandler<io.micronaut.http.HttpRequest<?>,
,io.micronaut.http.MutableHttpResponse<?>> RedirectingLoginHandler<io.micronaut.http.HttpRequest<?>,
io.micronaut.http.MutableHttpResponse<?>>
@Requires(classes=io.micronaut.http.HttpRequest.class) @Requires(property="micronaut.security.authentication",value="cookie")
@Singleton
public class TokenCookieLoginHandler
extends CookieLoginHandler
- Since:
- 1.0
- Author:
- Sergio del Amo
-
Field Summary
Modifier and TypeFieldDescriptionprotected final AccessRefreshTokenGenerator
protected final AccessTokenConfiguration
protected final RefreshTokenCookieConfiguration
Fields inherited from class io.micronaut.security.token.cookie.CookieLoginHandler
accessTokenCookieConfiguration, loginFailure, loginSuccess, priorToLoginPersistence, refresh
-
Constructor Summary
ConstructorDescriptionTokenCookieLoginHandler
(RedirectService redirectService, RedirectConfiguration redirectConfiguration, AccessTokenCookieConfiguration accessTokenCookieConfiguration, RefreshTokenCookieConfiguration refreshTokenCookieConfiguration, AccessTokenConfiguration accessTokenConfiguration, AccessRefreshTokenGenerator accessRefreshTokenGenerator, @Nullable PriorToLoginPersistence<io.micronaut.http.HttpRequest<?>, io.micronaut.http.MutableHttpResponse<?>> priorToLoginPersistence) Deprecated, for removal: This API element is subject to removal in a future version.TokenCookieLoginHandler
(RedirectService redirectService, RedirectConfiguration redirectConfiguration, AccessTokenCookieConfiguration accessTokenCookieConfiguration, RefreshTokenCookieConfiguration refreshTokenCookieConfiguration, AccessTokenConfiguration accessTokenConfiguration, AccessRefreshTokenGenerator accessRefreshTokenGenerator, @Nullable PriorToLoginPersistence<io.micronaut.http.HttpRequest<?>, io.micronaut.http.MutableHttpResponse<?>> priorToLoginPersistence, List<LoginCookieProvider<io.micronaut.http.HttpRequest<?>>> loginCookieProviders) -
Method Summary
Modifier and TypeMethodDescriptionList<io.micronaut.http.cookie.Cookie>
getCookies
(Authentication authentication, io.micronaut.http.HttpRequest<?> request) Return the cookies for the given parameters.List<io.micronaut.http.cookie.Cookie>
getCookies
(Authentication authentication, String refreshToken, io.micronaut.http.HttpRequest<?> request) Return the cookies for the given parameters.protected List<io.micronaut.http.cookie.Cookie>
getCookies
(AccessRefreshToken accessRefreshToken, io.micronaut.http.HttpRequest<?> request) Return the cookies for the given parameters.Methods inherited from class io.micronaut.security.token.cookie.CookieLoginHandler
applyCookies, createRefreshResponse, createSuccessResponse, loginFailed, loginRefresh, loginSuccess
-
Field Details
-
accessRefreshTokenGenerator
-
refreshTokenCookieConfiguration
-
accessTokenConfiguration
-
-
Constructor Details
-
TokenCookieLoginHandler
@Inject public TokenCookieLoginHandler(RedirectService redirectService, RedirectConfiguration redirectConfiguration, AccessTokenCookieConfiguration accessTokenCookieConfiguration, RefreshTokenCookieConfiguration refreshTokenCookieConfiguration, AccessTokenConfiguration accessTokenConfiguration, AccessRefreshTokenGenerator accessRefreshTokenGenerator, @Nullable @Nullable PriorToLoginPersistence<io.micronaut.http.HttpRequest<?>, io.micronaut.http.MutableHttpResponse<?>> priorToLoginPersistence, List<LoginCookieProvider<io.micronaut.http.HttpRequest<?>>> loginCookieProviders) - Parameters:
redirectService
- Redirection ServiceredirectConfiguration
- Redirect configurationaccessTokenCookieConfiguration
- JWT Access Token Cookie ConfigurationrefreshTokenCookieConfiguration
- Refresh Token Cookie ConfigurationaccessTokenConfiguration
- JWT Generator ConfigurationaccessRefreshTokenGenerator
- Access Refresh Token GeneratorpriorToLoginPersistence
- Prior To Login Persistence MechanismloginCookieProviders
- Login Cookie Providers
-
TokenCookieLoginHandler
@Deprecated(forRemoval=true, since="4.11.0") public TokenCookieLoginHandler(RedirectService redirectService, RedirectConfiguration redirectConfiguration, AccessTokenCookieConfiguration accessTokenCookieConfiguration, RefreshTokenCookieConfiguration refreshTokenCookieConfiguration, AccessTokenConfiguration accessTokenConfiguration, AccessRefreshTokenGenerator accessRefreshTokenGenerator, @Nullable @Nullable PriorToLoginPersistence<io.micronaut.http.HttpRequest<?>, io.micronaut.http.MutableHttpResponse<?>> priorToLoginPersistence) Deprecated, for removal: This API element is subject to removal in a future version.- Parameters:
redirectService
- Redirection ServiceredirectConfiguration
- Redirect configurationaccessTokenCookieConfiguration
- JWT Access Token Cookie ConfigurationrefreshTokenCookieConfiguration
- Refresh Token Cookie ConfigurationaccessTokenConfiguration
- JWT Generator ConfigurationaccessRefreshTokenGenerator
- Access Refresh Token GeneratorpriorToLoginPersistence
- Prior To Login Persistence Mechanism
-
-
Method Details
-
getCookies
public List<io.micronaut.http.cookie.Cookie> getCookies(Authentication authentication, io.micronaut.http.HttpRequest<?> request) Description copied from class:CookieLoginHandler
Return the cookies for the given parameters. This method will generate new cookies based on the current configuration.- Specified by:
getCookies
in classCookieLoginHandler
- Parameters:
authentication
- The Authenticated user's representationrequest
- The current request- Returns:
- A list of cookies
-
getCookies
public List<io.micronaut.http.cookie.Cookie> getCookies(Authentication authentication, String refreshToken, io.micronaut.http.HttpRequest<?> request) Description copied from class:CookieLoginHandler
Return the cookies for the given parameters. This method will generate new cookies based on the current configuration.- Specified by:
getCookies
in classCookieLoginHandler
- Parameters:
authentication
- The Authenticated user's representationrefreshToken
- The access refresh tokenrequest
- The current request- Returns:
- A list of cookies
-
getCookies
protected List<io.micronaut.http.cookie.Cookie> getCookies(AccessRefreshToken accessRefreshToken, io.micronaut.http.HttpRequest<?> request) Return the cookies for the given parameters.- Parameters:
accessRefreshToken
- The access refresh tokenrequest
- The current request- Returns:
- A list of cookies
-
TokenCookieLoginHandler(RedirectService, RedirectConfiguration, AccessTokenCookieConfiguration, RefreshTokenCookieConfiguration, AccessTokenConfiguration, AccessRefreshTokenGenerator, PriorToLoginPersistence, List)
instead.