Class DefaultTokenResolver
java.lang.Object
io.micronaut.security.token.reader.DefaultTokenResolver
- All Implemented Interfaces:
TokenResolver<io.micronaut.http.HttpRequest<?>>
@Requires(classes=io.micronaut.http.HttpRequest.class)
@Singleton
public class DefaultTokenResolver
extends Object
implements TokenResolver<io.micronaut.http.HttpRequest<?>>
Default implementation of
TokenResolver
.- Since:
- 1.1.0
- Author:
- Sergio del Amo
-
Constructor Summary
ConstructorDescriptionDefaultTokenResolver
(Collection<TokenReader<io.micronaut.http.HttpRequest<?>>> tokenReaders) Deprecated, for removal: This API element is subject to removal in a future version.DefaultTokenResolver
(List<TokenReader<io.micronaut.http.HttpRequest<?>>> tokenReaders) Instantiates aDefaultTokenResolver
with a list of availableTokenReader
. -
Method Summary
Modifier and TypeMethodDescriptionresolveToken
(io.micronaut.http.HttpRequest<?> request) Returns the first token found by the supplied token readers.resolveTokens
(@NonNull io.micronaut.http.HttpRequest<?> request) Returns tokens found by the supplied token readers.
-
Constructor Details
-
DefaultTokenResolver
@Deprecated(forRemoval=true, since="4.4.0") public DefaultTokenResolver(Collection<TokenReader<io.micronaut.http.HttpRequest<?>>> tokenReaders) Deprecated, for removal: This API element is subject to removal in a future version.Instantiates aDefaultTokenResolver
with a list of availableTokenReader
.- Parameters:
tokenReaders
- Collection of availableTokenReader
beans.
-
DefaultTokenResolver
@Inject public DefaultTokenResolver(List<TokenReader<io.micronaut.http.HttpRequest<?>>> tokenReaders) Instantiates aDefaultTokenResolver
with a list of availableTokenReader
.- Parameters:
tokenReaders
- Collection of availableTokenReader
beans.- Since:
- 4.4.0
-
-
Method Details
-
resolveTokens
@NonNull public @NonNull List<String> resolveTokens(@NonNull @NonNull io.micronaut.http.HttpRequest<?> request) Description copied from interface:TokenResolver
Returns tokens found by the supplied token readers.- Specified by:
resolveTokens
in interfaceTokenResolver<io.micronaut.http.HttpRequest<?>>
- Parameters:
request
- The current HTTP request.- Returns:
- the tokens found in the supplied request.
-
resolveToken
Returns the first token found by the supplied token readers.- Specified by:
resolveToken
in interfaceTokenResolver<io.micronaut.http.HttpRequest<?>>
- Parameters:
request
- The current HTTP request.- Returns:
- the first found token in the supplied request.
-
DefaultTokenResolver(java.util.List<io.micronaut.security.token.reader.TokenReader<io.micronaut.http.HttpRequest<?>>>)
instead.