The authentication handler.
public interface IAuthenticationHandler
Authentication handlers implementing this interface can be registered with the server. The server calls the authentication handlers when a client application creates a session, or changes the principal associated with a session, allowing the handler to veto individual requests.
Authentication handlers are configured in precedence order. Authentication will succeed if a handler returns Allow() and all higher precedence handlers (earlier in the order) return Abstain(). Authentication will fail if a handler returns Deny() and all higher precedence handlers return Abstain(). If all authentication handlers return Abstain(), the request will be denied. Once the outcome is known, the server may choose not to call the remaining handlers.
The special variant of Allow(IAuthenticationResult) may be used by the handler to supply the server with additional information that is used to set up the session.
Authenticate(String, ICredentials, ISessionDetails, IAuthenticationHandlerCallback)
void Authenticate(string principal, ICredentials credentials, ISessionDetails sessionDetails, IAuthenticationHandlerCallback callback)
The requested principal name, or
The credentials to authenticate the given
The information the server has about the client.
The single-use authentication callback.
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
callback. The handler may return immediately and process the authentication
request asynchronously. The client session will be blocked until a callback method is called.