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 Summary
Fields inherited from interface io.micronaut.core.order.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
Constructor Summary
-
Method Summary
Methods inherited from class io.micronaut.security.token.reader.HttpHeaderTokenReader
extractTokenFromAuthorization, findToken
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.micronaut.security.token.reader.TokenReader
findToken
-
Field Details
-
ORDER
-
bearerTokenConfiguration
-
-
Constructor Details
-
BearerTokenReader
- Parameters:
bearerTokenConfiguration
- Instance ofBearerTokenConfiguration
-
-
Method Details
-
getHeaderName
- Specified by:
getHeaderName
in classHttpHeaderTokenReader
- Returns:
- an HTTP Header name. e.g. Authorization
-
getPrefix
- Specified by:
getPrefix
in classHttpHeaderTokenReader
- Returns:
- a Prefix before the token in the header value. E.g. Basic
-
getOrder
public int getOrder()- Specified by:
getOrder
in interfaceio.micronaut.core.order.Ordered
-