Class AccessRefreshToken

java.lang.Object
io.micronaut.security.token.render.AccessRefreshToken
Direct Known Subclasses:
BearerAccessRefreshToken

public class AccessRefreshToken extends Object
Stores the combination of access and refresh tokens.
Since:
1.0
Author:
Sergio del Amo
  • Constructor Details

    • AccessRefreshToken

      @Creator public AccessRefreshToken(@NonNull @NonNull String accessToken, @Nullable @Nullable String refreshToken, @NonNull @NonNull String tokenType, @Nullable @Nullable Integer expiresIn)
      Parameters:
      accessToken - JWT token
      refreshToken - JWT token
      tokenType - Type of token
      expiresIn - Seconds until token expiration
    • AccessRefreshToken

      public AccessRefreshToken()
      Empty constructor. To support Jackson data bind without bean-introspection module.
  • Method Details

    • getAccessToken

      @NonNull public @NonNull String getAccessToken()
      accessToken getter.
      Returns:
      The access token
    • getRefreshToken

      @Nullable public @Nullable String getRefreshToken()
      refreshToken getter.
      Returns:
      The refresh token
    • getTokenType

      @NonNull public @NonNull String getTokenType()
      token type getter.
      Returns:
      TokenType e.g. Bearer
    • getExpiresIn

      @Nullable public @Nullable Integer getExpiresIn()
      lifetime in seconds of the access token getter.
      Returns:
      expiration time
    • setAccessToken

      public void setAccessToken(String accessToken)
      Parameters:
      accessToken - Access token
    • setRefreshToken

      public void setRefreshToken(String refreshToken)
      Parameters:
      refreshToken - Refresh token
    • setTokenType

      public void setTokenType(String tokenType)
      Parameters:
      tokenType - TokenType e.g. Bearer
    • setExpiresIn

      public void setExpiresIn(Integer expiresIn)
      Parameters:
      expiresIn - lifetime in seconds of the access token