oada-client-secret
v1.0.0
Published
OADA Client Secret library
Downloads
6
Readme
oada-client-secret
A node library for creating and verifying client secrets
Examples
var clientSecret = require('oada-client-secret');
var id = getOAuth2SessionClientId();
var accessCode = getOAuth2SessionAccessCode();
var audience = getOAuth2SessionAudience();
var issuer = getOAuth2Issuer();
var key = getSigningKey();
// Generate Client Secret
var cSecret = clientSecret.generate(key, issuer, audience, accessCode);
// Verify Client Secret
clientSecret.verify(id, cSecret, accessCode, audience, function(err, valid) {
if(valid) {
// Approve OAuth 2.0 request
}
});