Class JwtCookieLoginHandler
- java.lang.Object
-
- io.micronaut.security.token.jwt.cookie.JwtCookieLoginHandler
-
- All Implemented Interfaces:
LoginHandler
,RedirectingLoginHandler
@Singleton public class JwtCookieLoginHandler extends java.lang.Object implements RedirectingLoginHandler
- Since:
- 1.0
- Author:
- Sergio del Amo
-
-
Field Summary
Fields Modifier and Type Field Description protected AccessRefreshTokenGenerator
accessRefreshTokenGenerator
protected JwtCookieConfiguration
jwtCookieConfiguration
protected JwtGeneratorConfiguration
jwtGeneratorConfiguration
-
Constructor Summary
Constructors Constructor Description JwtCookieLoginHandler(JwtCookieConfiguration jwtCookieConfiguration, JwtGeneratorConfiguration jwtGeneratorConfiguration, AccessRefreshTokenGenerator accessRefreshTokenGenerator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description io.micronaut.http.HttpResponse
loginFailed(AuthenticationFailed authenticationFailed)
io.micronaut.http.HttpResponse
loginSuccess(UserDetails userDetails, io.micronaut.http.HttpRequest<?> request)
-
-
-
Field Detail
-
jwtCookieConfiguration
protected final JwtCookieConfiguration jwtCookieConfiguration
-
accessRefreshTokenGenerator
protected final AccessRefreshTokenGenerator accessRefreshTokenGenerator
-
jwtGeneratorConfiguration
protected final JwtGeneratorConfiguration jwtGeneratorConfiguration
-
-
Constructor Detail
-
JwtCookieLoginHandler
public JwtCookieLoginHandler(JwtCookieConfiguration jwtCookieConfiguration, JwtGeneratorConfiguration jwtGeneratorConfiguration, AccessRefreshTokenGenerator accessRefreshTokenGenerator)
- Parameters:
jwtCookieConfiguration
- JWT Cookie ConfigurationjwtGeneratorConfiguration
- JWT Generator ConfigurationaccessRefreshTokenGenerator
- Access Refresh Token Generator
-
-
Method Detail
-
loginSuccess
public io.micronaut.http.HttpResponse loginSuccess(UserDetails userDetails, io.micronaut.http.HttpRequest<?> request)
- Specified by:
loginSuccess
in interfaceLoginHandler
- Parameters:
userDetails
- Authenticated user's representation.request
- TheHttpRequest
being executed- Returns:
- An HTTP Response. Eg. a redirect or an JWT token rendered to the response
-
loginFailed
public io.micronaut.http.HttpResponse loginFailed(AuthenticationFailed authenticationFailed)
- Specified by:
loginFailed
in interfaceLoginHandler
- Parameters:
authenticationFailed
- Object encapsulates the Login failure- Returns:
- An HTTP Response. Eg. a redirect or 401 response
-
-