Interface IAuthenticationControl
The authentication control feature that 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
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 a ISession with the AuthenticationControl property.
Methods
SetAuthenticationHandler(String, IEnumerable<DetailType>, IControlAuthenticationHandler)
Registera a handler for client authentication events.
Declaration
void SetAuthenticationHandler(string handlerName, IEnumerable<DetailType> requestedDetail, IControlAuthenticationHandler handler)
Parameters
Type | Name | Description |
---|---|---|
String | handlerName | The name of the handler. |
IEnumerable<DetailType> | requestedDetail | The session details that the server should supply, if available. |
IControlAuthenticationHandler | handler | The authentication handler to set. |
Remarks
Deprecated: The IControlAuthenticationHandler has been replaced by the IControlAuthenticator interface. New authentication handlers should implement IControlAuthenticator and use SetAuthenticationHandlerAsync(String, IControlAuthenticator) instead. This method will be removed in a future release.
Each handler is registered under a particular handlerName
. For registration to succeed,
the server's security configuration must include a matching control-authentication-handler
entry for
the name. Otherwise registration will fail, the handler will be closed immediately, and an error will be
reported to the session error handler.
Each control session may register a single handler for a handlerName
. See
OnActive(IRegisteredHandler).
It is normal for several or all of the control sessions in a control group to set a handler for a given name. Registration will fail if a session in a different control group has registered a handler using the 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 a handler and all higher prioritychandlers have abstained.
For a configured control authentication handler, the server will select a single handler from those
registered for the handlerName
. If no handlers are currently registered, the server will
consult the next handler.
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 |