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.
npm i auth0-api-tokens
var TOKEN_EXPIRATION_IN_SECONDS = 3600;
var createToken = require('auth0-api-tokens')({
clientId: '{YOUR_GLOBAL_CLIENT_ID}',
clientSecret: '{YOUR_GLOBAL_CLIENT_Secret}',
}, TOKEN_EXPIRATION_IN_SECONDS)
// each key is an entity, each array element is an action
var token = createToken({
users: ['read', 'write'],
clients: ['delete']
});
console.log(token); // 'ey...'
For more information about auth0 contact our documentation page.
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.
This project is licensed under the MIT license. See the LICENSE file for more info.