@Singleton public class JwtCookieLoginHandler extends java.lang.Object implements RedirectingLoginHandler
Modifier and Type | Field and Description |
---|---|
protected AccessRefreshTokenGenerator |
accessRefreshTokenGenerator |
protected JwtCookieConfiguration |
jwtCookieConfiguration |
protected JwtGeneratorConfiguration |
jwtGeneratorConfiguration |
Constructor and Description |
---|
JwtCookieLoginHandler(JwtCookieConfiguration jwtCookieConfiguration,
JwtGeneratorConfiguration jwtGeneratorConfiguration,
AccessRefreshTokenGenerator accessRefreshTokenGenerator) |
Modifier and Type | Method and Description |
---|---|
protected java.util.Optional<io.micronaut.http.cookie.Cookie> |
accessTokenCookie(UserDetails userDetails,
io.micronaut.http.HttpRequest<?> request) |
io.micronaut.http.HttpResponse |
loginFailed(AuthenticationFailed authenticationFailed) |
io.micronaut.http.HttpResponse |
loginSuccess(UserDetails userDetails,
io.micronaut.http.HttpRequest<?> request) |
protected io.micronaut.http.HttpResponse |
loginSuccessWithCookies(java.util.List<io.micronaut.http.cookie.Cookie> cookies) |
protected final JwtCookieConfiguration jwtCookieConfiguration
protected final AccessRefreshTokenGenerator accessRefreshTokenGenerator
protected final JwtGeneratorConfiguration jwtGeneratorConfiguration
public JwtCookieLoginHandler(JwtCookieConfiguration jwtCookieConfiguration, JwtGeneratorConfiguration jwtGeneratorConfiguration, AccessRefreshTokenGenerator accessRefreshTokenGenerator)
jwtCookieConfiguration
- JWT Cookie ConfigurationjwtGeneratorConfiguration
- JWT Generator ConfigurationaccessRefreshTokenGenerator
- Access Refresh Token Generatorpublic io.micronaut.http.HttpResponse 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.HttpResponse loginFailed(AuthenticationFailed authenticationFailed)
loginFailed
in interface LoginHandler
authenticationFailed
- Object encapsulates the Login failureprotected java.util.Optional<io.micronaut.http.cookie.Cookie> accessTokenCookie(UserDetails userDetails, io.micronaut.http.HttpRequest<?> request)
userDetails
- Authenticated user's representation.request
- The HttpRequest
being executedprotected io.micronaut.http.HttpResponse loginSuccessWithCookies(java.util.List<io.micronaut.http.cookie.Cookie> cookies)
cookies
- Cookies to be added to the response