Class TokenCookieTokenReader

java.lang.Object
io.micronaut.security.token.cookie.TokenCookieTokenReader
All Implemented Interfaces:
io.micronaut.core.order.Ordered, TokenReader<io.micronaut.http.HttpRequest<?>>

@Requires(classes=io.micronaut.http.HttpRequest.class) @Requires(condition=CookieBasedAuthenticationModeCondition.class) @Requires(property="micronaut.security.token.cookie.enabled",notEquals="false",defaultValue="true") @Singleton public class TokenCookieTokenReader extends Object implements TokenReader<io.micronaut.http.HttpRequest<?>>
Reads the token from the configured io.micronaut.security.token.jwt.cookie.
Since:
1.0
Author:
Sergio del Amo
  • Field Details

  • Constructor Details

    • TokenCookieTokenReader

      public TokenCookieTokenReader(AccessTokenCookieConfiguration accessTokenCookieConfiguration)
      Parameters:
      accessTokenCookieConfiguration - Configuration properties for JWT Cookie support
  • Method Details

    • findToken

      public Optional<String> findToken(io.micronaut.http.HttpRequest<?> request)
      Description copied from interface: TokenReader
      Attempts to retrieve a token in a request.
      Specified by:
      findToken in interface TokenReader<io.micronaut.http.HttpRequest<?>>
      Parameters:
      request - The request to look for the token in
      Returns:
      An optional token string
    • getOrder

      public int getOrder()
      Specified by:
      getOrder in interface io.micronaut.core.order.Ordered