Constructor
new ClientGrantsManager(options)
- Source:
Parameters:
Name | Type | Description | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object
|
The client options.
|
Members
(inner) auth0RestClient :external:RestClient
Provides an abstraction layer for consuming the Auth0 Client Grants endpoint.
- Source:
Type:
(inner) clientOptions :Object
Options object for the Rest Client instance.
- Source:
Type:
-
Object
Methods
create(data, cbopt) → {Promise|undefined}
Create an Auth0 client grant.
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
data |
Object
|
The client data object. |
|
cb |
function
|
<optional> |
Callback function. |
Returns:
- Type:
-
Promise
|undefined
Example
management.clientGrants.create(data, function (err) {
if (err) {
// Handle error.
}
// Client grant created.
});
create(data, cbopt) → {Promise|undefined}
Create an Auth0 client grant.
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
data |
Object
|
The client data object. |
|
cb |
function
|
<optional> |
Callback function. |
Returns:
- Type:
-
Promise
|undefined
Example
management.clientGrants.create(data, function (err) {
if (err) {
// Handle error.
}
// Client grant created.
});
delete(params, cbopt) → {Promise|undefined}
Delete an Auth0 client grant.
Parameters:
Name | Type | Attributes | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
params |
Object
|
Client parameters.
|
|||||||
cb |
function
|
<optional> |
Callback function. |
Returns:
- Type:
-
Promise
|undefined
Example
management.clientGrants.delete({ id: GRANT_ID }, function (err) {
if (err) {
// Handle error.
}
// Grant deleted.
});
delete(params, cbopt) → {Promise|undefined}
Delete an Auth0 client grant.
- Source:
Parameters:
Name | Type | Attributes | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
params |
Object
|
Client parameters.
|
|||||||
cb |
function
|
<optional> |
Callback function. |
Returns:
- Type:
-
Promise
|undefined
Example
management.clientGrants.delete({ id: GRANT_ID }, function (err) {
if (err) {
// Handle error.
}
// Grant deleted.
});
getAll(cbopt) → {Promise|undefined}
Get all Auth0 Client Grants.
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
cb |
function
|
<optional> |
Callback function. |
Returns:
- Type:
-
Promise
|undefined
Example
management.clientGrants.getAll(function (err, grants) {
console.log(grants.length);
});
getAll(cbopt) → {Promise|undefined}
Get all Auth0 Client Grants.
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
cb |
function
|
<optional> |
Callback function. |
Returns:
- Type:
-
Promise
|undefined
Example
management.clientGrants.getAll(function (err, grants) {
console.log(grants.length);
});
update(params, data, cbopt) → {Promise|undefined}
Update an Auth0 client grant.
- Source:
Parameters:
Name | Type | Attributes | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
params |
Object
|
Client parameters.
|
|||||||
data |
Object
|
Updated client data. |
|||||||
cb |
function
|
<optional> |
Callback function. |
Returns:
- Type:
-
Promise
|undefined
Example
var data = {
client_id: CLIENT_ID,
audience: AUDIENCE,
scope: []
};
var params = { id: CLIENT_GRANT_ID };
management.clientGrants.update(params, data, function (err, grant) {
if (err) {
// Handle error.
}
console.log(grant.id);
});
update(params, data, cbopt) → {Promise|undefined}
Update an Auth0 client grant.
- Source:
Parameters:
Name | Type | Attributes | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
params |
Object
|
Client parameters.
|
|||||||
data |
Object
|
Updated client data. |
|||||||
cb |
function
|
<optional> |
Callback function. |
Returns:
- Type:
-
Promise
|undefined
Example
var data = {
client_id: CLIENT_ID,
audience: AUDIENCE,
scope: []
};
var params = { id: CLIENT_GRANT_ID };
management.clientGrants.update(params, data, function (err, grant) {
if (err) {
// Handle error.
}
console.log(grant.id);
});