Class DefaultTokenResolver
- java.lang.Object
-
- io.micronaut.security.token.reader.DefaultTokenResolver
-
- All Implemented Interfaces:
TokenResolver
@Singleton public class DefaultTokenResolver extends java.lang.Object implements TokenResolver
Default implementation ofTokenResolver
.- Since:
- 1.1.0
- Author:
- Sergio del Amo
-
-
Constructor Summary
Constructors Constructor Description DefaultTokenResolver(java.util.Collection<TokenReader> tokenReaders)
Instantiates aDefaultTokenResolver
with a list of availableTokenReader
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Optional<java.lang.String>
resolveToken(io.micronaut.http.HttpRequest<?> request)
Returns the first token found by the supplied token readers.
-
-
-
Constructor Detail
-
DefaultTokenResolver
public DefaultTokenResolver(java.util.Collection<TokenReader> tokenReaders)
Instantiates aDefaultTokenResolver
with a list of availableTokenReader
.- Parameters:
tokenReaders
- Collection of availableTokenReader
beans.
-
-
Method Detail
-
resolveToken
public java.util.Optional<java.lang.String> resolveToken(io.micronaut.http.HttpRequest<?> request)
Returns the first token found by the supplied token readers.- Specified by:
resolveToken
in interfaceTokenResolver
- Parameters:
request
- The current HTTP request.- Returns:
- the first found token in the supplied request.
-
-