auth0-api-tokens
Library that given Auth0 global client credentials allows users to generate JWT tokens for API v2.
You can read more about API v2 tokens in this blog post and in the API explorer.
Installation
npm i auth0-api-tokens
Usage
var TOKEN_EXPIRATION_IN_SECONDS = 3600;
var createToken = require('auth0-api-tokens')({
clientId: '{YOUR_GLOBAL_CLIENT_ID}',
clientSecret: '{YOUR_GLOBAL_CLIENT_Secret}',
})
var token = createToken({
scopes: {
users: ['read', 'write'],
clients: ['delete']
},
lifetimeInSeconds: TOKEN_EXPIRATION_IN_SECONDS
});
console.log(token);
Documentation
For more information about auth0 contact our documentation page.
Issue Reporting
If you have found a bug or if you have a feature request, please report them at this repository issues section. Please do not report security vulnerabilities on the public GitHub issue tracker. The Responsible Disclosure Program details the procedure for disclosing security issues.
Author
Auth0
License
This project is licensed under the MIT license. See the LICENSE file for more info.