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 JwtCookieConfiguration |
jwtCookieConfiguration |
protected java.lang.String |
loginFailure |
protected java.lang.String |
loginSuccess |
protected PriorToLoginPersistence |
priorToLoginPersistence |
protected java.lang.String |
refresh |
Constructor and Description |
---|
CookieLoginHandler(JwtCookieConfiguration jwtCookieConfiguration,
RedirectConfiguration redirectConfiguration,
PriorToLoginPersistence priorToLoginPersistence) |
CookieLoginHandler(JwtCookieConfiguration jwtCookieConfiguration,
java.lang.String loginSuccess,
java.lang.String loginFailure)
Deprecated.
|
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) |
protected abstract java.util.List<io.micronaut.http.cookie.Cookie> |
getCookies(UserDetails userDetails,
io.micronaut.http.HttpRequest<?> request) |
protected abstract java.util.List<io.micronaut.http.cookie.Cookie> |
getCookies(UserDetails userDetails,
java.lang.String refreshToken,
io.micronaut.http.HttpRequest<?> request) |
io.micronaut.http.MutableHttpResponse<?> |
loginFailed(AuthenticationResponse authenticationFailed,
io.micronaut.http.HttpRequest<?> request) |
io.micronaut.http.MutableHttpResponse<?> |
loginRefresh(UserDetails userDetails,
java.lang.String refreshToken,
io.micronaut.http.HttpRequest<?> request) |
io.micronaut.http.MutableHttpResponse<?> |
loginSuccess(UserDetails userDetails,
io.micronaut.http.HttpRequest<?> request) |
protected final JwtCookieConfiguration jwtCookieConfiguration
protected final PriorToLoginPersistence priorToLoginPersistence
protected final java.lang.String loginFailure
protected final java.lang.String loginSuccess
protected final java.lang.String refresh
@Inject public CookieLoginHandler(JwtCookieConfiguration jwtCookieConfiguration, RedirectConfiguration redirectConfiguration, @Nullable PriorToLoginPersistence priorToLoginPersistence)
redirectConfiguration
- Redirect configurationjwtCookieConfiguration
- JWT Cookie ConfigurationpriorToLoginPersistence
- The prior to login persistence strategy@Deprecated public CookieLoginHandler(JwtCookieConfiguration jwtCookieConfiguration, java.lang.String loginSuccess, java.lang.String loginFailure)
CookieLoginHandler(JwtCookieConfiguration, RedirectConfiguration, PriorToLoginPersistence)
instead.jwtCookieConfiguration
- JWT Cookie ConfigurationloginSuccess
- Url to redirect to after a successful LoginloginFailure
- Url to redirect to after an unsuccessful loginprotected abstract java.util.List<io.micronaut.http.cookie.Cookie> getCookies(UserDetails userDetails, io.micronaut.http.HttpRequest<?> request)
protected abstract java.util.List<io.micronaut.http.cookie.Cookie> getCookies(UserDetails userDetails, java.lang.String refreshToken, io.micronaut.http.HttpRequest<?> request)
public io.micronaut.http.MutableHttpResponse<?> loginSuccess(UserDetails userDetails, io.micronaut.http.HttpRequest<?> request)
loginSuccess
in interface LoginHandler
userDetails
- 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 executedpublic io.micronaut.http.MutableHttpResponse<?> loginRefresh(UserDetails userDetails, java.lang.String refreshToken, io.micronaut.http.HttpRequest<?> request)
loginRefresh
in interface LoginHandler
userDetails
- Authenticated user's representation.refreshToken
- The refresh tokenrequest
- The HttpRequest
being executedprotected io.micronaut.http.MutableHttpResponse<?> createSuccessResponse(io.micronaut.http.HttpRequest<?> request)
request
- The requestprotected io.micronaut.http.MutableHttpResponse<?> createRefreshResponse(io.micronaut.http.HttpRequest<?> request)
request
- The requestprotected 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