public static interface Authenticator.MessageAuthenticator
Message
s.
Authentication is performed using AuthenticationToken.AuthenticationTokenResolver
s to parse request message into standard
AuthenticationToken
.
Modifier and Type | Method and Description |
---|---|
void |
addAuthenticationTokenResolver(AuthenticationToken.AuthenticationTokenResolver<?> authenticationTokenResolver)
Add an
AuthenticationToken.AuthenticationTokenResolver to translate messages into AuthenticationToken s. |
Authentication |
authenticate(Message<?,?> message,
String... schemes)
Try to authenticate given
message with the same contract as
Authenticator.authenticate(AuthenticationToken) . |
<T extends Message> |
getResolversForMessageType(Class<T> messageType)
Get available
AuthenticationToken.AuthenticationTokenResolver s for given message type |
boolean |
supportsMessage(Class<? extends Message<?,?>> messageType)
Check whether this MessageAuthenticator supports given message type
|
void addAuthenticationTokenResolver(AuthenticationToken.AuthenticationTokenResolver<?> authenticationTokenResolver)
AuthenticationToken.AuthenticationTokenResolver
to translate messages into AuthenticationToken
s.authenticationTokenResolver
- The AuthenticationToken.AuthenticationTokenResolver
to add (not null)boolean supportsMessage(Class<? extends Message<?,?>> messageType)
messageType
- Message type to checktrue
if message type is supported<T extends Message> List<AuthenticationToken.AuthenticationTokenResolver<T>> getResolversForMessageType(Class<T> messageType)
AuthenticationToken.AuthenticationTokenResolver
s for given message typeT
- Message typemessageType
- Message typeAuthentication authenticate(Message<?,?> message, String... schemes) throws AuthenticationException
message
with the same contract as
Authenticator.authenticate(AuthenticationToken)
.
Message-based authentication is performed using a resolvers chain: all available resolvers for given message
type are called in the order they where registered, and the first not null AuthenticationToken
returned by a resolver is used for attempting authentication.
message
- Request messageschemes
- Optional authentication schemes to use. If not null or empty, only
AuthenticationToken.AuthenticationTokenResolver
s bound to given scheme names will be usedAuthenticationException
- Authentication failedCopyright © 2019 The Holon Platform. All rights reserved.