![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
jwt-generator
Advanced tools
Generates 'json web token' (JWT) by using the API of the authentication server.
This package is being used by the home automation project. The package generates 'JSON Web Token' (JWT) by using the API of the authentication server.
$ npm install --save jwt-generator
The package supports ES5 or later. The example below is using ES6 features.
Here you can find instructions on how to generate private & public keys.
const JWTGenerator = require('jwt-generator')
// const jwtGenerator = new JWTGenerator({loginUrl: <url>, privateKey: <privateKey>, useRetry: <use retry>, issuer: <issuer>})
const jwtGenerator = new JWTGenerator({loginUrl: 'https://auth.domain.com', privateKey: '<privateKey>', useRetry: true, issuer: 'urn:home-automation/garage-door-raspberry-client'})
// jwtGenerator.makeNewToken({subject: <subject>, audience: <audience>, payload: <payload>, expiresIn: <expires (seconds)>})
jwtGenerator.makeNewToken({subject: 'report garage door state', audience: 'urn:home-automation/garage-door-api', payload: {"name": "John Doe", "admin": true}, expiresIn: 60})
.then((token) => {
// JWT generated by the authentication server.
})
// jwtGenerator.makeToken({subject: <subject>, audience: <audience>, payload: <payload>, expiresIn: <expires (seconds)>})
jwtGenerator.makeToken({subject: 'report garage door state', audience: 'urn:home-automation/garage-door-api', payload: {"name": "John Doe", "admin": true}, expiresIn: 60})
.then((token) => {
// JWT generated by the authentication server.
})
The difference between makeToken
and makeNewToken
is that the former may re-use existing token that has been stored in the cached,
while the latter will always generate new token by calling the authentication server.
FAQs
Generates 'json web token' (JWT) by using the API of the authentication server.
The npm package jwt-generator receives a total of 15 weekly downloads. As such, jwt-generator popularity was classified as not popular.
We found that jwt-generator demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.