AuthenticationHandler
is being replaced by
Authenticator
. This class will be removed in a future
release.
@Deprecated public class CompositeAuthenticationHandler extends Object implements AuthenticationHandler
AuthenticationHandler
that delegates to a list of handlers.
This class is useful when there are several steps to authentication implemented as discrete authentication handlers. It provides an alternative to adding each of the authentication handlers to the server configuration. Usually this class will be extended to create an single application-specific handler that hard-codes the creation of the discrete handlers.
The authenticate(java.lang.String, com.pushtechnology.diffusion.client.types.Credentials, com.pushtechnology.diffusion.client.details.SessionDetails, com.pushtechnology.diffusion.client.security.authentication.AuthenticationHandler.Callback)
method will be called on the discrete handlers in
order until a handler either allows or denies the connection. The next
handler is only called once the preceding one uses the callback to abstain.
If an exception is thrown it is not propagated and is treated in the same way
as calling deny on the callback.
AuthenticationHandler.Callback
Constructor and Description |
---|
CompositeAuthenticationHandler(AuthenticationHandler... handlers)
Deprecated.
Create a composite authentication handler.
|
CompositeAuthenticationHandler(List<? extends AuthenticationHandler> handlers)
Deprecated.
Create a composite authentication handler.
|
Modifier and Type | Method and Description |
---|---|
void |
authenticate(String principal,
Credentials credentials,
SessionDetails sessionDetails,
AuthenticationHandler.Callback callback)
Deprecated.
Request authentication.
|
protected List<? extends AuthenticationHandler> |
getHandlers()
Deprecated.
|
String |
toString()
Deprecated.
|
public CompositeAuthenticationHandler(List<? extends AuthenticationHandler> handlers)
handlers
- the handlerspublic CompositeAuthenticationHandler(AuthenticationHandler... handlers)
handlers
- the handlerspublic final void authenticate(String principal, Credentials credentials, SessionDetails sessionDetails, AuthenticationHandler.Callback callback)
AuthenticationHandler
The server calls this to authenticate new sessions, and when a client
requests the session principal is changed (or example, using
Security.changePrincipal(String, Credentials, Security.ChangePrincipalCallback)
.
For each call to authenticate
, the authentication handler should
respond by calling one of the methods of the provided callback
.
The handler may return immediately and process the authentication request
asynchronously. The client session will be blocked until a callback
method is called.
authenticate
in interface AuthenticationHandler
principal
- the requested principal name, or
Session.ANONYMOUS
if none was suppliedcredentials
- authenticating the principal; for example, a passwordsessionDetails
- the information the server has about the clientcallback
- single use callbackprotected final List<? extends AuthenticationHandler> getHandlers()
Copyright © 2020 Push Technology Ltd. All Rights Reserved.