BlacklistedTokensManager

management. BlacklistedTokensManager

BlacklistedTokensManager The BlacklistedTokensManager class provides methods to retrieve the list of blacklisted tokens and blacklist new ones..

Constructor

new BlacklistedTokensManager(options)

Source:
Parameters:
Name Type Description
options Object

The client options.

Name Type Attributes Description
baseUrl String

The URL of the API.

headers Object <optional>

Headers to be included in all requests.

retry Object <optional>

Retry Policy Config

Members

(inner) auth0RestClient :external:RestClient

Provides an abstraction layer for consuming the Auth0 Blacklisted Tokens endpoint.

Source:
Type:

(inner) clientOptions :Object

Options object for the Rest Client instace.

Source:
Type:
  • Object

Methods

add(token, cbopt) → {Promise|undefined}

Blacklist a new token.

Source:
Parameters:
Name Type Attributes Description
token Object

Token data.

Name Type Description
aud String

Audience (your app client ID).

jti String

The JWT ID claim.

cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Example
var token = {
 aud: 'aud',
 jti: 'jti'
};

management.blacklistedTokens.add(token, function (err) {
  if (err) {
    // Handle error.
  }

  // Token blacklisted.
});

getAll(cbopt) → {Promise|undefined}

Get all blacklisted tokens.

Source:
Parameters:
Name Type Attributes Description
cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Example
management.blacklistedTokens.getAll(function (err, tokens) {
  console.log(tokens.length);
});