Class AccessRefreshTokenLoginHandler

java.lang.Object
io.micronaut.security.token.jwt.bearer.AccessRefreshTokenLoginHandler
All Implemented Interfaces:
LoginHandler

@Requires(property="micronaut.security.authentication", value="bearer") @Singleton public class AccessRefreshTokenLoginHandler extends Object implements LoginHandler
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
      Parameters:
      authentication - Authenticated user's representation.
      request - The HttpRequest 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
      Parameters:
      authentication - Authenticated user's representation.
      refreshToken - The refresh token
      request - The HttpRequest 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
      Parameters:
      authenticationFailed - Object encapsulates the Login failure
      request - The HttpRequest being executed
      Returns:
      An HTTP Response. Eg. a redirect or 401 response