Authentication

auth. Authentication

Handles the authentication of incoming requests

Constructor

new Authentication()

Source:

Members

plugins :Object

Source:
Registered authentication plugins
Type:
  • Object

Methods

(async, static) init() → {Promise}

Source:
Creates and instanciates the class
Returns:
Resolves with the instance
Type
Promise

(async) checkHandler(req, res, next)

Source:
Verifies the incoming request is correctly authenticated
Parameters:
Name Type Description
req external:ExpressRequest
res external:ExpressResponse
next function

(async) disavowHandler(req, res, next)

Source:
Verifies the incoming request is correctly authenticated
Parameters:
Name Type Description
req external:ExpressRequest
res external:ExpressResponse
next function

(async) disavowUser(query) → {Promise}

Source:
Deauthenticates a user
Parameters:
Name Type Description
query object Token search query
Returns:
Type
Promise

(async) generateTokenHandler(req, res, next)

Source:
Handles token generation requests
Parameters:
Name Type Description
req external:ExpressRequest
res external:ExpressResponse
next function

(async) init(auth) → {Promise}

Source:
Initialises the instance
Parameters:
Name Type Description
auth AuthModule The app auth module instance
Returns:
Type
Promise

registerPlugin(type, instance)

Source:
Registers a module to be used for authentication
Parameters:
Name Type Description
type String Identifier for the module
instance AbstractAuthModule The auth module to register

(async) registerUser(authType, userData) → {Promise}

Source:
Shortcut to authentication helper function
Parameters:
Name Type Description
authType String Authentication type
userData Object Data to be inserted if user doesn't exist
Returns:
Type
Promise

(async) retrieveTokensHandler(req, res, next)

Source:
Handles token retrieval requests
Parameters:
Name Type Description
req external:ExpressRequest
res external:ExpressResponse
next function