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 Details

  • Constructor Details

    • AccessRefreshTokenLoginHandler

      public AccessRefreshTokenLoginHandler(AccessRefreshTokenGenerator accessRefreshTokenGenerator)
      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 interface LoginHandler<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 interface LoginHandler<io.micronaut.http.HttpRequest<?>,io.micronaut.http.MutableHttpResponse<?>>
      Parameters:
      authentication - Authenticated user's representation.
      refreshToken - The refresh token
      request - 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 interface LoginHandler<io.micronaut.http.HttpRequest<?>,io.micronaut.http.MutableHttpResponse<?>>
      Parameters:
      authenticationFailed - Object encapsulates the Login failure
      request - The HTTP Request being executed
      Returns:
      An HTTP Response. Eg. a redirect or 401 response