Module

auth

Authorization

View Source auth.js, line 1

Members

object

# inner constant auth

Authorization token properties and actions object.

Properties:
Name Type Description
token Object

The current authorization token (retrieved from the API).

getBaseUrl function

Get the base URL for the RewardOps authorization token.

getTokenUrl function

Get the authorization token URL for the RewardOps API.

getTokenPath function

Get the value of TOKEN_PATH.

invalidateToken function

Invalidate (clear) the authorization token.

getToken getToken

Get authorization token.

View Source auth.js, line 68

# protected inner constant TOKEN_PATH

URL path for the authorization token in the RewardOps API.

View Source auth.js, line 27

Methods

# async protected inner getToken(config, callback)

Get authorization token.

Repeated calls to this function mid-stream are handled gracefully in order to prevent race conditions.

Parameters:
Name Type Attributes Description
config object

Configuration object used by request function.

clientId string

RewardOps API OAuth client_id.

clientSecret string

RewardOps API OAuth client_secret.

timeout string <optional>

Timeout for HTTP requests (used by Request).

callback module:api~requestCallback

Callback that handles the response.

View Source auth.js, line 231

# async protected inner requestToken(requestOptions, retryStrategy, callback)

Safe request authorization token method.

If the initial responses have errors, a retry strategy is employed.

Parameters:
Name Type Description
requestOptions object

Options for a Request POST call.

retryStrategy Object

Request retry strategy options.

callback module:api~requestCallback

Callback that handles the response.

View Source auth.js, line 112