GrantsManager

management. GrantsManager

GrantsManager Auth0 Grants Manager.

See Grants

Constructor

new GrantsManager(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 Grants endpoint.

Source:
Type:

(inner) clientOptions :Object

Options object for the Rest Client instance.

Source:
Type:
  • Object

Methods

delete(params, cbopt) → {Promise|undefined}

Delete an Auth0 grant.

Source:
Parameters:
Name Type Attributes Description
params Object

Grant parameters.

Name Type Description
id String

Grant ID.

user_id String

The user_id of the grants to delete.

cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Example
var params = {
   id: 'GRANT_ID',
   user_id: 'USER_ID'
};

management.deleteGrant(params, function (err) {
  if (err) {
    // Handle error.
  }

  // Grant deleted.
});

deleteGrant(params, cbopt) → {Promise|undefined}

Delete an Auth0 grant.

Source:
Parameters:
Name Type Attributes Description
params Object

Grant parameters.

Name Type Description
id String

Grant ID.

user_id String

The user_id of the grants to delete.

cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Example
var params = {
   id: GRANT_ID,
   user_id: USER_ID
};

management.deleteGrant(params, function (err) {
  if (err) {
    // Handle error.
  }

  // Grant deleted.
});

getAll(params, cbopt) → {Promise|undefined}

Get all Auth0 Grants.

Source:
Parameters:
Name Type Attributes Description
params Object

Grants parameters.

Name Type Description
per_page Number

Number of results per page.

page Number

Page number, zero indexed.

include_totals Boolean

true if a query summary must be included in the result, false otherwise. Default false;

user_id String

The user_id of the grants to retrieve.

client_id String

The client_id of the grants to retrieve.

audience String

The audience of the grants to retrieve.

cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Example
var params = {
  per_page: 10,
  page: 0,
  include_totals: true,
  user_id: 'USER_ID',
  client_id: 'CLIENT_ID',
  audience: 'AUDIENCE'
};

management.getGrants(params, function (err, grants) {
  console.log(grants.length);
});