Interface IAuthenticationControl
This feature allows a client session to authenticate the credentials of other sessions.
Inherited Members
Namespace: PushTechnology.ClientInterface.Client.Features.Control.Clients
Assembly: Diffusion.Client.dll
Syntax
public interface IAuthenticationControl : IFeature
Remarks
Sessions are authenticated by a chain of authentication handlers. A client session can participate in the authentication process by creating an authentication handler and registering it with the server.
Each authentication handler is registered under a particular handler name.
For registration to succeed, the server's security configuration must include
a matching control-authentication-handler
entry for the name,
otherwise registration will fail and the authentication handler will be
closed immediately.
Each client session can register a single authentication handler for a given handler name.
For each authentication event, the server will use its configuration to determine the handler priority order. The server may call authentication handlers in serial or parallel. The server may stop the authentication process as soon as it has an allow or deny response from an authentication handler and all higher priority authentication handlers have abstained.
For a configured control authentication handler, the server will select a single handler from those registered for the handler name. If no authenticators are currently registered, the server will consult the next configured authentication handler in priority order.
Access control
In order to register an authentication handler a session needs both REGISTER_HANDLER and AUTHENTICATE permissions.
Accessing the feature
This feature may be obtained from an ISession as follows:
var authenticationControl = session.AuthenticationControl;
Added in version 5.0.
Methods
SetAuthenticationHandlerAsync(String, IControlAuthenticator)
Registers an authentication handler for client authentication events.
Declaration
Task<IRegistration> SetAuthenticationHandlerAsync(string handlerName, IControlAuthenticator authenticator)
Parameters
Type | Name | Description |
---|---|---|
String | handlerName | The handler name which must match an entry in the server's security configuration. |
IControlAuthenticator | authenticator | The authentication handler. |
Returns
Type | Description |
---|---|
Task<IRegistration> | The |
Remarks
If the task completes successfully, the Task
result will be IRegistration
which can be used to unregister the authentication handler.
Exceptions
Type | Condition |
---|---|
SessionException | The server configuration does not contain a |
SessionSecurityException | The calling session does not have the REGISTER_HANDLER or
AUTHENTICATE permission. Thrown by the returned |
SessionClosedException | The session is closed. Thrown by the returned |
SetAuthenticationHandlerAsync(String, IControlAuthenticator, CancellationToken)
Registers an authentication handler for client authentication events.
Declaration
Task<IRegistration> SetAuthenticationHandlerAsync(string handlerName, IControlAuthenticator authenticator, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
String | handlerName | The handler name which must match an entry in the server's security configuration. |
IControlAuthenticator | authenticator | The authentication handler. |
CancellationToken | cancellationToken | The cancellation token used to cancel the current operation. |
Returns
Type | Description |
---|---|
Task<IRegistration> | The |
Remarks
If the task completes successfully, the Task
result will be IRegistration
which can be used to unregister the authentication handler.
Exceptions
Type | Condition |
---|---|
SessionException | The server configuration does not contain a |
SessionSecurityException | The calling session does not have the REGISTER_HANDLER or
AUTHENTICATE permission. Thrown by the returned |
SessionClosedException | The session is closed. Thrown by the returned |