Interface: BaseChannelAuth

BaseChannelAuth

Interface for authentication classes used with channel requests.

Source:

Methods

authenticate(requestOptions, callback)

Authenticate the user for an HTTP channel request. The supplied callback should be invoked with the results of the authentication attempt. See BaseChannelAuth~authCallback for more information on the content provided to the callback.

Parameters:
Name Type Description
requestOptions Object

Options included in the HTTP channel request.

callback BaseChannelAuth~authCallback

Callback function invoked with the results of the authentication attempt.

Source:

reset()

Purge any credentials cached from a previous authentication.

Source:

Type Definitions

authCallback(authErroropt, requestOptionsopt)

Callback invoked with the result of a call to BaseChannelAuth#authenticate.

Parameters:
Name Type Attributes Description
authError Error <optional>

If no errors occurred during authentication, this parameter is null. For an error due to the user not being authorized, this parameter contains an instance of a PermanentAuthenticationError object. For an unexpected/unknown error, this parameter contains an instance of a TemporaryAuthenticationError object.

requestOptions Object <optional>

If any errors occurred during authentication, this parameter is null. Otherwise, this parameter includes the requestOptions object supplied in the BaseChannelAuth#authenticate call. The requestOptions object may include additional properties for the authenticated user. For example, if the user were mapped to a bearer auth token, the auth property for the requestOptions object supplied to the callback could be set to:

  {bearer: '<the user token>'}
Source: