Constructor
new BlacklistedTokensManager(options)
Parameters:
Name |
Type |
Description |
options |
Object
|
The client options.
Properties
Name |
Type |
Attributes |
Description |
baseUrl |
String
|
|
The URL of the API. |
headers |
Object
|
<optional>
|
Headers to be included in all requests. |
|
- Source:
Members
Type:
- Source:
(inner) clientOptions :Object
Options object for the Rest Client instace.
Type:
- Source:
Methods
add(token, cbopt) → {Promise|undefined}
Blacklist a new token.
Parameters:
Name |
Type |
Attributes |
Description |
token |
Object
|
|
Token data.
Properties
Name |
Type |
Description |
aud |
String
|
Audience (your app client ID). |
jti |
String
|
The JWT ID claim. |
|
cb |
function
|
<optional>
|
Callback function. |
- Source:
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.
Parameters:
Name |
Type |
Attributes |
Description |
cb |
function
|
<optional>
|
Callback function. |
- Source:
Returns:
-
Type
-
Promise
|
undefined
Example
management.blacklistedTokens.getAll(function (err, tokens) {
console.log(tokens.length);
});