Class TokenAuthenticationNames

java.lang.Object
io.micronaut.security.token.TokenAuthenticationNames

@Internal public final class TokenAuthenticationNames extends Object
Resolves the name token based authentication gives to a user on later requests from the Authentication a token is issued for, the way AbstractTokenAuthenticationFactory resolves it from the claims of the token: the TokenConfiguration.getNameKey() claim, falling back to the sub claim, which is the principal name.
Since:
5.5.2
Author:
Sergio del Amo
  • Method Details

    • asResolvedFromToken

      public static @NonNull Authentication asResolvedFromToken(@NonNull TokenConfiguration tokenConfiguration, @NonNull Authentication authentication)
      Parameters:
      tokenConfiguration - Token Configuration
      authentication - The authentication a token is issued for
      Returns:
      The authentication named as token based authentication names the user from the issued token, or the supplied authentication if the name is the same