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 TokenValidatorBasic Auth Token Validator.- Since:
- 1.0
- Author:
- Sergio del Amo
-
-
Field Summary
Fields Modifier and Type Field Description protected Authenticatorauthenticatorstatic java.lang.IntegerORDERThe 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 intgetOrder()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:TokenValidatorValidates the provided token and returns the authentication state.- Specified by:
validateTokenin interfaceTokenValidator- Parameters:
encodedToken- The token string- Returns:
- The authentication or
Optional.empty()if the validation fails
-
getOrder
public int getOrder()
- Specified by:
getOrderin interfaceio.micronaut.core.order.Ordered
-
-