Class BasicAuthTokenValidator
- java.lang.Object
-
- io.micronaut.security.token.basicauth.BasicAuthTokenValidator
-
- All Implemented Interfaces:
io.micronaut.core.order.Ordered
,TokenValidator
@Requires(property="micronaut.security.token.basic-auth.enabled", notEquals="false") @Singleton public class BasicAuthTokenValidator extends java.lang.Object implements TokenValidator
Basic Auth Token Validator.- Since:
- 1.0
- Author:
- Sergio del Amo
-
-
Field Summary
Fields Modifier and Type Field Description protected Authenticator
authenticator
static java.lang.Integer
ORDER
The order of the TokenValidator.
-
Constructor Summary
Constructors Constructor Description BasicAuthTokenValidator(Authenticator authenticator)
Deprecated.BasicAuthTokenValidator(Authenticator authenticator, TokenConfiguration tokenConfiguration)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getOrder()
org.reactivestreams.Publisher<Authentication>
validateToken(java.lang.String encodedToken)
Validates the provided token and returns the authentication state.
-
-
-
Field Detail
-
ORDER
public static final java.lang.Integer ORDER
The order of the TokenValidator.
-
authenticator
protected final Authenticator authenticator
-
-
Constructor Detail
-
BasicAuthTokenValidator
@Deprecated public BasicAuthTokenValidator(Authenticator authenticator)
Deprecated.- Parameters:
authenticator
- The Authenticator
-
BasicAuthTokenValidator
@Inject public BasicAuthTokenValidator(Authenticator authenticator, TokenConfiguration tokenConfiguration)
- Parameters:
authenticator
- The AuthenticatortokenConfiguration
- The Token configuration.
-
-
Method Detail
-
validateToken
public org.reactivestreams.Publisher<Authentication> validateToken(java.lang.String encodedToken)
Description copied from interface:TokenValidator
Validates the provided token and returns the authentication state.- Specified by:
validateToken
in interfaceTokenValidator
- Parameters:
encodedToken
- The token string- Returns:
- The authentication or
Optional.empty()
if the validation fails
-
getOrder
public int getOrder()
- Specified by:
getOrder
in interfaceio.micronaut.core.order.Ordered
-
-