Class CompositeAuthenticationHandler
The IAuthenticationHandler implementation that delegates to a list of handlers.
Implements
Namespace: PushTechnology.ClientInterface.Client.Security.Authentication
Assembly: Diffusion.Client.dll
Syntax
public class CompositeAuthenticationHandler : object, IAuthenticationHandler
Remarks
Deprecated: IAuthenticationHandler is being replaced by IAuthenticator. This class will be removed in a future release.
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(String, ICredentials, ISessionDetails, IAuthenticationHandlerCallback) 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.
Constructors
CompositeAuthenticationHandler(List<IAuthenticationHandler>)
Initializes a new CompositeAuthenticationHandler instance.
Declaration
public CompositeAuthenticationHandler(List<IAuthenticationHandler> handlers)
Parameters
Type | Name | Description |
---|---|---|
List<IAuthenticationHandler> | handlers | The list of authentication handlers. |
CompositeAuthenticationHandler(IAuthenticationHandler[])
Initializes a new CompositeAuthenticationHandler instance.
Declaration
public CompositeAuthenticationHandler(params IAuthenticationHandler[] handlers)
Parameters
Type | Name | Description |
---|---|---|
IAuthenticationHandler[] | handlers | A variable list of authentication handlers. |
Properties
Handlers
Gets the delegate handler list.
Declaration
public List<IAuthenticationHandler> Handlers { get; }
Property Value
Type | Description |
---|---|
List<IAuthenticationHandler> | The delegate handler list. |
Methods
Authenticate(String, ICredentials, ISessionDetails, IAuthenticationHandlerCallback)
Requests authentication.
Declaration
public void Authenticate(string principal, ICredentials credentials, ISessionDetails sessionDetails, IAuthenticationHandlerCallback callback)
Parameters
Type | Name | Description |
---|---|---|
String | principal | The requested principal name, or |
ICredentials | credentials | The credentials to authenticate the given |
ISessionDetails | sessionDetails | The information the server has about the client. |
IAuthenticationHandlerCallback | callback | The single-use authentication callback. |
Remarks
The server calls this to authenticate new sessions, and when a client requests the session principal to be changed (for example, using ChangePrincipalAsync(String, ICredentials)).
For each call to this method, 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.
ToString()
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String |