Constructor
new DeviceCredentialsManager(options)
Parameters:
Name | Type | Description | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object
|
The client options.
|
Members
(inner) auth0RestClient :external:RestClient
Provides an abstraction layer for consuming the Auth0 DeviceCredentialsManagers endpoint.
Type:
(inner) clientOptions :Object
Options object for the RestClient instance.
Type:
-
Object
Methods
create(data, cbopt) → {Promise|undefined}
Create an Auth0 credential.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
data |
Object
|
The device credential data object. |
|
cb |
function
|
<optional> |
Callback function. |
Returns:
- Type:
-
Promise
|undefined
Example
management.deviceCredentials.create(data, function (err) {
if (err) {
// Handle error.
}
// Credential created.
});
delete(params, cbopt) → {Promise|undefined}
Delete an Auth0 device credential.
Parameters:
Name | Type | Attributes | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
params |
Object
|
Credential parameters.
|
|||||||
cb |
function
|
<optional> |
Callback function. |
Returns:
- Type:
-
Promise
|undefined
Example
var params = { id: CREDENTIAL_ID };
management.deviceCredentials.delete(params, function (err) {
if (err) {
// Handle error.
}
// Credential deleted.
});
getAll(cbopt) → {Promise|undefined}
Get all Auth0 credentials.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
cb |
function
|
<optional> |
Callback function. |
Returns:
- Type:
-
Promise
|undefined
Example
management.deviceCredentials.getAll(function (err, credentials) {
console.log(credentials.length);
});