ConnectionsManager

management. ConnectionsManager

ConnectionsManager Represents the relationship between Auth0 and an Identity provider.

Constructor

new ConnectionsManager(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 performing CRUD operations on Auth0 Connections.

Source:
Type:

(inner) clientOptions :Object

Options object for the Rest Client instance.

Source:
Type:
  • Object

Methods

create(data, cbopt) → {Promise|undefined}

Create a new connection.

Source:
Parameters:
Name Type Attributes Description
data Object

Connection data object.

cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Example
management.connections.create(data, function (err) {
  if (err) {
    // Handle error.
  }

  // Conection created.
});

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

Delete an existing connection.

Source:
Parameters:
Name Type Attributes Description
params Object

Connection parameters.

Name Type Description
id String

Connection ID.

cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Example
management.connections.delete({ id: CONNECTION_ID }, function (err) {
  if (err) {
    // Handle error.
  }

  // Conection deleted.
});

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

Get an Auth0 connection.

Source:
Parameters:
Name Type Attributes Description
params Object

Connection parameters.

Name Type Description
id String

Connection ID.

cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Example
management.connections.get({ id: CONNECTION_ID }, function (err, connection) {
  if (err) {
    // Handle error.
  }

  console.log(connection);
});

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

Get all connections.

Source:
Parameters:
Name Type Attributes Description
params Object <optional>

Connections params.

Name Type Attributes Description
per_page Number <optional>

Number of results per page.

page Number <optional>

Page number, zero indexed.

cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Example

This method takes an optional object as first argument that may be used to specify pagination settings. If pagination options are not present, the first page of a limited number of results will be returned.

// Pagination settings.
var params = {
  per_page: 10,
  page: 0
};

management.connections.getAll(params, function (err, connections) {
  console.log(connections.length);
});

update(params, data, cbopt) → {Promise|undefined}

Update an existing connection.

Source:
Parameters:
Name Type Attributes Description
params Object

Conneciton parameters.

Name Type Description
id String

Connection ID.

data Object

Updated connection data.

cb function <optional>

Callback function.

Returns:
Type:
Promise | undefined
Example
var data = { name: 'newConnectionName' };
var params = { id: CONNECTION_ID };

management.connections.update(params, data, function (err, connection) {
  if (err) {
    // Handle error.
  }

  console.log(connection.name);  // 'newConnectionName'
});