Class: Callback

AuthenticationHandler. Callback


new Callback()

Single-use callback provided to the onAuthenticate call.

The server calls the handlers for each authentication request. Each handler must respond allow, abstain, or deny.

The handler may provide additional information to the allow method with a user-supplied AuthenticationResult object.

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.

Methods


abstain()


allow( [result])

Authentication passed - allow the authentication request

Parameters:
Name Type Argument Description
result AuthenticationHandler.Callback.AuthenticationResult <optional>

Optional roles/properties to assign to the authenticated session

Examples
// Basic allow
callback.allow();
// Allow with AuthenticationResult
callback.allow({
    roles : ['SOME_ROLE'],
    properties : {
        MyPropertyKey : 'MyPropertyValue'
    }
});

deny()

Authentication failed - deny the authentication request.

Type Definitions


AuthenticationResult

Additional information supplied to the server upon a successful authentication.

Properties:
Name Type Description
roles Array.<String>

Additional roles to be assigned to the authenticated session

properties Object.<String, String>

Additional properties to be assigned to the authenticated session