Class AccessRefreshTokenLoginHandler
- java.lang.Object
-
- io.micronaut.security.token.jwt.bearer.AccessRefreshTokenLoginHandler
-
- All Implemented Interfaces:
LoginHandler
@Requires(property="micronaut.security.token.jwt.bearer.enabled", notEquals="false") @Primary @Singleton public class AccessRefreshTokenLoginHandler extends java.lang.Object implements LoginHandler
Implementation ofLoginHandler
for Token Based Authentication.- Since:
- 1.0
- Author:
- Sergio del Amo
-
-
Field Summary
Fields Modifier and Type Field Description protected AccessRefreshTokenGenerator
accessRefreshTokenGenerator
-
Constructor Summary
Constructors Constructor Description AccessRefreshTokenLoginHandler(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
-
accessRefreshTokenGenerator
protected final AccessRefreshTokenGenerator accessRefreshTokenGenerator
-
-
Constructor Detail
-
AccessRefreshTokenLoginHandler
public AccessRefreshTokenLoginHandler(AccessRefreshTokenGenerator accessRefreshTokenGenerator)
- Parameters:
accessRefreshTokenGenerator
- AccessRefresh 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
-
-