Class AccessRefreshTokenLoginHandler
java.lang.Object
io.micronaut.security.token.bearer.AccessRefreshTokenLoginHandler
- All Implemented Interfaces:
LoginHandler<io.micronaut.http.HttpRequest<?>,
io.micronaut.http.MutableHttpResponse<?>>
@Requires(classes={io.micronaut.http.HttpRequest.class,io.micronaut.http.MutableHttpResponse.class}) @Requires(property="micronaut.security.authentication",value="bearer")
@Singleton
public class AccessRefreshTokenLoginHandler
extends Object
implements LoginHandler<io.micronaut.http.HttpRequest<?>,io.micronaut.http.MutableHttpResponse<?>>
Implementation of
LoginHandler
for Token Based Authentication.- Since:
- 1.0
- Author:
- Sergio del Amo
-
Field Summary
-
Constructor Summary
ConstructorDescriptionAccessRefreshTokenLoginHandler
(AccessRefreshTokenGenerator accessRefreshTokenGenerator) -
Method Summary
Modifier and TypeMethodDescriptionio.micronaut.http.MutableHttpResponse<?>
loginFailed
(AuthenticationResponse authenticationFailed, io.micronaut.http.HttpRequest<?> request) io.micronaut.http.MutableHttpResponse<?>
loginRefresh
(Authentication authentication, String refreshToken, io.micronaut.http.HttpRequest<?> request) io.micronaut.http.MutableHttpResponse<?>
loginSuccess
(Authentication authentication, io.micronaut.http.HttpRequest<?> request)
-
Field Details
-
accessRefreshTokenGenerator
-
-
Constructor Details
-
AccessRefreshTokenLoginHandler
- Parameters:
accessRefreshTokenGenerator
- AccessRefresh Token generator
-
-
Method Details
-
loginSuccess
public io.micronaut.http.MutableHttpResponse<?> loginSuccess(Authentication authentication, io.micronaut.http.HttpRequest<?> request) - Specified by:
loginSuccess
in interfaceLoginHandler<io.micronaut.http.HttpRequest<?>,
io.micronaut.http.MutableHttpResponse<?>> - Parameters:
authentication
- Authenticated user's representation.request
- The HTTP Request being executed- Returns:
- An HTTP Response. Eg. a redirect or an JWT token rendered to the response
-
loginRefresh
public io.micronaut.http.MutableHttpResponse<?> loginRefresh(Authentication authentication, String refreshToken, io.micronaut.http.HttpRequest<?> request) - Specified by:
loginRefresh
in interfaceLoginHandler<io.micronaut.http.HttpRequest<?>,
io.micronaut.http.MutableHttpResponse<?>> - Parameters:
authentication
- Authenticated user's representation.refreshToken
- The refresh tokenrequest
- The HTTP Request being executed- Returns:
- An HTTP Response. Eg. a redirect or an JWT token rendered to the response
-
loginFailed
public io.micronaut.http.MutableHttpResponse<?> loginFailed(AuthenticationResponse authenticationFailed, io.micronaut.http.HttpRequest<?> request) - Specified by:
loginFailed
in interfaceLoginHandler<io.micronaut.http.HttpRequest<?>,
io.micronaut.http.MutableHttpResponse<?>> - Parameters:
authenticationFailed
- Object encapsulates the Login failurerequest
- The HTTP Request being executed- Returns:
- An HTTP Response. Eg. a redirect or 401 response
-