auth0-api-tokens
Advanced tools
Comparing version 1.1.1 to 1.1.2
{ | ||
"name": "auth0-api-tokens", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "Library that given a Auth0 global client credentials allows users to generate JWT tokens for API v2", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -26,9 +26,8 @@ var jwt = require('jsonwebtoken'); | ||
return jwt.sign(payload, | ||
new Buffer(credentials.clientSecret, 'base64').toString('binary'), { | ||
expiresIn: lifetimeInSeconds, | ||
audience: credentials.clientId, | ||
noTimestamp: true // we generate it before for the `jti` | ||
}); | ||
return jwt.sign(payload, new Buffer(credentials.clientSecret, 'base64'), { | ||
expiresIn: lifetimeInSeconds, | ||
audience: credentials.clientId, | ||
noTimestamp: true // we generate it before for the `jti` | ||
}); | ||
}; | ||
}; |
var expect = require('chai').expect; | ||
var jws = require('jws'); | ||
var jwt = require('jsonwebtoken'); | ||
var jws = require('jws'); | ||
var clientSecret = '3IbdgWA2kUk4MbIf1-17J5JjpcJDwOqFsVQ2TnrrzsVvwPTE84wNoEX8EdPpsn7F'; | ||
var createToken = require('..')({ | ||
clientId: 'my_client', | ||
clientSecret: '3IbdgWA2kUk4MbIf1-17J5JjpcJDwOqFsVQ2TnrrzsVvwPTE84wNoEX8EdPpsn7F' | ||
clientSecret: clientSecret | ||
}); | ||
@@ -59,2 +61,6 @@ | ||
}); | ||
it('should set a valid signature', function () { | ||
expect(jwt.verify(token, new Buffer(clientSecret, 'base64'))).to.be.a('object'); | ||
}); | ||
}); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6806
78