API Docs for: 1.5.0
Show:

HttpBasicAuthAgent Class

Creates an instance of HttpBasicAuthAgent object Auth agent handles low level implementation of authorization workflow

Constructor

HttpBasicAuthAgent

(
  • [credentials]
)

Parameters:

  • [credentials] Object optional

    object literal containg credentials for the REST service access

    • login String

      user login

    • password String

      user password

Methods

authenticateRequest

(
  • request
  • done
)

Hook to allow the modification of any request, for authentication purposes, before sending it out to the backend

Parameters:

ensureAuthentication

(
  • done
)

Called every time a new request cycle is started, to ensure those requests are correctly authenticated.

A cycle may contain one or more queued up requests

Parameters:

  • done Function

    Callback function, which is to be called by the implementation to signal the authentication has been completed.

isLoggedIn

(
  • done
)

Checks whether the user is logged in. For HttpBasicAuthAgent, it actually tries to load the root resource with the provided credentials.

Parameters:

  • done Function

logIn

(
  • done
)

Logs in the user by trying to load the root resource, it is the same as HttpBasicAuthAgent.isLoggedIn

Parameters:

  • done Function

logOut

(
  • done
)

Log out No actual logic for HTTP Basic Auth

Parameters:

  • done Function

setCAPI

(
  • CAPI
)

Set the instance of the CAPI to be used by the agent

Parameters:

  • CAPI CAPI

    current instance of the CAPI object

setCredentials

(
  • credentials
)

Set the credentials

Parameters:

  • credentials Object
    • login String
    • password String

Properties

_login

String protected

The login

Default: ""

_password

String protected

The password

Default: ""