Class: BasicAuthenticator

x2node-ws~ BasicAuthenticator

Authenticator that uses "Basic" HTTP authentication scheme (see RFC 7617).

new BasicAuthenticator(actorsRegistry [, realm])

Create new authenticator.
Parameters:
Name Type Argument Default Description
actorsRegistry module:x2node-ws.ActorsRegistry Actors registry.
realm string <optional>
Web Service The realm.
Implements:

Methods


addResponseHeaders(call, response)

If present on the authenticator, called before sending HTTP response to give the authenticator a chance to add any authenticator-specific headers to the response.
Parameters:
Name Type Description
call module:x2node-ws~ServiceCall The call.
response module:x2node-ws~ServiceResponse The response.
Implements:

authenticate(call)

Authenticate the call.
Parameters:
Name Type Description
call module:x2node-ws~ServiceCall The call.
Implements:
Returns:
Authenticated actor, null if could not authenticate, or a Promise of the above.
Type
module:x2node-common.Actor | Promise.<module:x2node-common.Actor>