auth0-api-tokens
Advanced tools
Comparing version 1.1.0 to 1.1.1
{ | ||
"name": "auth0-api-tokens", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "Library that given a Auth0 global client credentials allows users to generate JWT tokens for API v2", | ||
@@ -12,9 +12,9 @@ "main": "index.js", | ||
"dependencies": { | ||
"jsonwebtoken": "^4.2.2" | ||
"jsonwebtoken": "^5.4.0" | ||
}, | ||
"devDependencies": { | ||
"chai": "^2.2.0", | ||
"jws": "^2.0.0", | ||
"jws": "^3.1.0", | ||
"mocha": "^2.2.1" | ||
} | ||
} |
@@ -1,46 +0,5 @@ | ||
# auth0-api-tokens ![build status](https://travis-ci.org/auth0/auth0-api-tokens.svg?branch=master) | ||
# Deprecation notice | ||
Library that given Auth0 global client credentials allows users to generate JWT tokens for API v2. | ||
This library has been deprecated and is no longer supported. If you need a token for Auth0's Management API v2 you can instead execute a [client credentials flow](https://auth0.com/docs/api-auth/grant/client-credentials). | ||
You can read more about API v2 tokens in [this blog post](https://auth0.com/blog/2014/12/02/using-json-web-tokens-as-api-keys/) and in the [API explorer](https://docs.auth0.com/apiv2). | ||
## Installation | ||
``` | ||
npm i auth0-api-tokens | ||
``` | ||
## Usage | ||
```js | ||
var TOKEN_EXPIRATION_IN_SECONDS = 3600; | ||
var createToken = require('auth0-api-tokens')({ | ||
clientId: '{YOUR_GLOBAL_CLIENT_ID}', | ||
clientSecret: '{YOUR_GLOBAL_CLIENT_Secret}', | ||
}) | ||
// each key is an entity, each array element is an action | ||
var token = createToken({ | ||
scopes: { | ||
users: ['read', 'write'], | ||
clients: ['delete'] | ||
}, | ||
lifetimeInSeconds: TOKEN_EXPIRATION_IN_SECONDS | ||
}); | ||
console.log(token); // 'ey...' | ||
``` | ||
## Documentation | ||
For more information about [auth0](http://auth0.com) contact our [documentation page](http://docs.auth0.com/). | ||
## 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](https://auth0.com/whitehat) details the procedure for disclosing security issues. | ||
## Author | ||
[Auth0](auth0.com) | ||
## License | ||
This project is licensed under the MIT license. See the [LICENSE](LICENSE) file for more info. | ||
[The original README is still available.](README_DEPRECATED.md) |
@@ -28,3 +28,3 @@ var jwt = require('jsonwebtoken'); | ||
new Buffer(credentials.clientSecret, 'base64').toString('binary'), { | ||
expiresInSeconds: lifetimeInSeconds, | ||
expiresIn: lifetimeInSeconds, | ||
audience: credentials.clientId, | ||
@@ -34,2 +34,2 @@ noTimestamp: true // we generate it before for the `jti` | ||
}; | ||
}; | ||
}; |
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
6608
9
74
0
6
+ Addedjsonwebtoken@5.7.0(transitive)
+ Addedjwa@1.4.1(transitive)
+ Addedjws@3.2.2(transitive)
+ Addedms@0.7.3(transitive)
+ Addedxtend@4.0.2(transitive)
- Removedbase64url@0.0.61.0.6(transitive)
- Removedcamelcase@1.2.1(transitive)
- Removedcamelcase-keys@1.0.0(transitive)
- Removedconcat-stream@1.4.11(transitive)
- Removedcore-util-is@1.0.3(transitive)
- Removedget-stdin@4.0.1(transitive)
- Removedindent-string@1.2.2(transitive)
- Removedinherits@2.0.4(transitive)
- Removedis-finite@1.1.0(transitive)
- Removedisarray@0.0.1(transitive)
- Removedjsonwebtoken@4.2.2(transitive)
- Removedjwa@1.0.2(transitive)
- Removedjws@2.0.0(transitive)
- Removedmap-obj@1.0.1(transitive)
- Removedmeow@2.0.0(transitive)
- Removedminimist@1.2.8(transitive)
- Removedobject-assign@1.0.0(transitive)
- Removedreadable-stream@1.1.14(transitive)
- Removedrepeating@1.1.3(transitive)
- Removedstring_decoder@0.10.31(transitive)
- Removedtypedarray@0.0.7(transitive)
Updatedjsonwebtoken@^5.4.0