public abstract class CookieLoginHandler extends java.lang.Object implements RedirectingLoginHandler
RedirectingLoginHandler
where a redirect response is issued.
For a successful login a cookie is added to the response with a token.Modifier and Type | Field and Description |
---|---|
protected AccessTokenCookieConfiguration |
accessTokenCookieConfiguration |
protected java.lang.String |
loginFailure |
protected java.lang.String |
loginSuccess |
protected PriorToLoginPersistence |
priorToLoginPersistence |
protected java.lang.String |
refresh |
Constructor and Description |
---|
CookieLoginHandler(AccessTokenCookieConfiguration accessTokenCookieConfiguration,
RedirectConfiguration redirectConfiguration,
PriorToLoginPersistence priorToLoginPersistence) |
Modifier and Type | Method and Description |
---|---|
protected io.micronaut.http.MutableHttpResponse<?> |
applyCookies(io.micronaut.http.MutableHttpResponse<?> response,
java.util.List<io.micronaut.http.cookie.Cookie> cookies) |
protected io.micronaut.http.MutableHttpResponse<?> |
createRefreshResponse(io.micronaut.http.HttpRequest<?> request) |
protected io.micronaut.http.MutableHttpResponse<?> |
createSuccessResponse(io.micronaut.http.HttpRequest<?> request) |
abstract java.util.List<io.micronaut.http.cookie.Cookie> |
getCookies(Authentication authentication,
io.micronaut.http.HttpRequest<?> request)
Return the cookies for the given parameters.
|
abstract java.util.List<io.micronaut.http.cookie.Cookie> |
getCookies(Authentication authentication,
java.lang.String refreshToken,
io.micronaut.http.HttpRequest<?> request)
Return the cookies for the given parameters.
|
io.micronaut.http.MutableHttpResponse<?> |
loginFailed(AuthenticationResponse authenticationFailed,
io.micronaut.http.HttpRequest<?> request) |
io.micronaut.http.MutableHttpResponse<?> |
loginRefresh(Authentication authentication,
java.lang.String refreshToken,
io.micronaut.http.HttpRequest<?> request) |
io.micronaut.http.MutableHttpResponse<?> |
loginSuccess(Authentication authentication,
io.micronaut.http.HttpRequest<?> request) |
protected final AccessTokenCookieConfiguration accessTokenCookieConfiguration
protected final PriorToLoginPersistence priorToLoginPersistence
@Nullable protected final java.lang.String loginFailure
@Nullable protected final java.lang.String loginSuccess
@Nullable protected final java.lang.String refresh
public CookieLoginHandler(AccessTokenCookieConfiguration accessTokenCookieConfiguration, RedirectConfiguration redirectConfiguration, @Nullable PriorToLoginPersistence priorToLoginPersistence)
accessTokenCookieConfiguration
- Access token cookie configurationredirectConfiguration
- Redirect configurationpriorToLoginPersistence
- The prior to login persistence strategypublic abstract java.util.List<io.micronaut.http.cookie.Cookie> getCookies(Authentication authentication, io.micronaut.http.HttpRequest<?> request)
authentication
- The Authenticated user's representationrequest
- The current requestpublic abstract java.util.List<io.micronaut.http.cookie.Cookie> getCookies(Authentication authentication, java.lang.String refreshToken, io.micronaut.http.HttpRequest<?> request)
authentication
- The Authenticated user's representationrefreshToken
- The access refresh tokenrequest
- The current requestpublic io.micronaut.http.MutableHttpResponse<?> loginSuccess(Authentication authentication, io.micronaut.http.HttpRequest<?> request)
loginSuccess
in interface LoginHandler
authentication
- Authenticated user's representation.request
- The HttpRequest
being executedpublic io.micronaut.http.MutableHttpResponse<?> loginFailed(AuthenticationResponse authenticationFailed, io.micronaut.http.HttpRequest<?> request)
loginFailed
in interface LoginHandler
authenticationFailed
- Object encapsulates the Login failurerequest
- The HttpRequest
being executedloginFailure
is null, for example if RedirectConfiguration
is disabled.public io.micronaut.http.MutableHttpResponse<?> loginRefresh(Authentication authentication, java.lang.String refreshToken, io.micronaut.http.HttpRequest<?> request)
loginRefresh
in interface LoginHandler
authentication
- Authenticated user's representation.refreshToken
- The refresh tokenrequest
- The HttpRequest
being executedprotected io.micronaut.http.MutableHttpResponse<?> createSuccessResponse(io.micronaut.http.HttpRequest<?> request)
request
- The requestloginSuccess
is null, for example if RedirectConfiguration
is disabled.protected io.micronaut.http.MutableHttpResponse<?> createRefreshResponse(io.micronaut.http.HttpRequest<?> request)
request
- The requestrefresh
is null.protected io.micronaut.http.MutableHttpResponse<?> applyCookies(io.micronaut.http.MutableHttpResponse<?> response, java.util.List<io.micronaut.http.cookie.Cookie> cookies)
response
- The responsecookies
- Cookies to be added to the response