AuthenticationHandler
has been replaced by the
Authenticator
interface. New authentication handlers
should implement Authenticator. This class will be removed in a
future release.
@Deprecated public class CompositeControlAuthenticationHandler extends CompositeAuthenticationHandler implements AuthenticationControl.ControlAuthenticationHandler
CompositeAuthenticationHandler
that implements
AuthenticationControl.ControlAuthenticationHandler
.
This class is useful when there are several steps to authentication
implemented as discrete authentication handlers. Using a
CompositeAuthenticationHandler
is better than configuring separate
control-authentication-handlers
and registering the discrete handlers
individually because it reduces communication between the server and the
client.
The onActive(RegisteredHandler)
and onClose()
notifications
will be forwarded to all of the discrete handlers. If a discrete handler
throws an exception then the exception will be propagated after all discrete
handlers have been notified.
The CompositeAuthenticationHandler.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
ServerHandler.Default
Constructor and Description |
---|
CompositeControlAuthenticationHandler(AuthenticationHandler... handlers)
Deprecated.
Create a composite authentication handler.
|
CompositeControlAuthenticationHandler(List<? extends AuthenticationHandler> handlers)
Deprecated.
Create a composite authentication handler.
|
Modifier and Type | Method and Description |
---|---|
void |
onActive(RegisteredHandler registeredHandler)
Deprecated.
Called when the handler has been registered at the server and is now
active.
|
void |
onClose()
Deprecated.
Called if the handler is closed.
|
authenticate, getHandlers, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
authenticate
public CompositeControlAuthenticationHandler(List<? extends AuthenticationHandler> handlers)
handlers
- the handlerspublic CompositeControlAuthenticationHandler(AuthenticationHandler... handlers)
handlers
- the handlerspublic void onActive(RegisteredHandler registeredHandler)
A session can register at most one a single handler of each type. If
there is already a handler registered the operation will fail,
registeredHandler
will be closed, and the session error handler
will be notified. To change the handler, first
close
the previous handler.
If a handler closes the registeredHandler
, the entire composite
handler will be unregistered.
onActive
in interface ServerHandler
registeredHandler
- a reference that allows the handler to be closedpublic void onClose()
ServerHandler
close
.onClose
in interface ServerHandler
Copyright © 2020 Push Technology Ltd. All Rights Reserved.