Handler Namespace


Classes


BaseAuthHandler

constructor

With the help of this method you can create a new instance of BaseAuthHandler.

Signature

constructor(Object options) : Object

Parameters

  • options
    • Options of the base authentication handler
    • Type: Object

Returns

  • Object
    • Options of the base authentication handler

middleware

Do some preparation before the authentication and fetch the representations of the user and credentials according to the authentication adapter.

Signature

middleware(Object req, Object res, Function next) : void

Parameters

  • req
    • The Request
    • Type: Object
  • res
    • The Response
    • Type: Object
  • next
    • Function to call when finished
    • Type: Function

process

Use a configured authentication adapter to authenticate.

Signature

process(Object username, Object credentials, Object req, Function next) : void

Parameters

  • username
    • The given username
    • Type: Object
  • credentials
    • The given password
    • Type: Object
  • req
    • The Request
    • Type: Object
  • next
    • Function to call when finished
    • Type: Function

post

Do some postprocessing after the authentication.

Signature

post(Boolean isAuthenticated, Function callback) : void

Parameters

  • isAuthenticated
    • Has the user been authenticated?
    • Type: Boolean
  • callback
    • Function to call when finished
    • Type: Function


HttpAuthHandler

constructor

With the help of this method you can create a new instance of HttpAuthHandler.

Signature

constructor(Object options) : Object

Parameters

  • options
    • Options of the HTTP authentication handler
    • Type: Object

Returns

  • Object
    • Options of the HTTP authentication handler

middleware

Do some preparation before the authentication and set the headers of the HTTP auth popup.

Signature

middleware(Object req, Object res, Function next) : void

Parameters

  • req
    • The Request
    • Type: Object
  • res
    • The Response
    • Type: Object
  • next
    • Function to call when finished
    • Type: Function