Class BearerTokenReader

java.lang.Object
io.micronaut.security.token.reader.HttpHeaderTokenReader
io.micronaut.security.token.bearer.BearerTokenReader
All Implemented Interfaces:
io.micronaut.core.order.Ordered, TokenReader<io.micronaut.http.HttpRequest<?>>

@Requires(classes=io.micronaut.http.HttpRequest.class) @Requires(property="micronaut.security.token.bearer.enabled",notEquals="false") @Singleton public class BearerTokenReader extends HttpHeaderTokenReader implements TokenReader<io.micronaut.http.HttpRequest<?>>
Reads JWT token from HttpHeaders.AUTHORIZATION header. e.g. Bearer XXXXX.
Since:
1.0
Author:
Sergio del Amo
  • Field Details

  • Constructor Details

  • Method Details

    • getHeaderName

      protected String getHeaderName()
      Specified by:
      getHeaderName in class HttpHeaderTokenReader
      Returns:
      an HTTP Header name. e.g. Authorization
    • getPrefix

      protected String getPrefix()
      Specified by:
      getPrefix in class HttpHeaderTokenReader
      Returns:
      a Prefix before the token in the header value. E.g. Basic
    • getOrder

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