Skip to content

Latest commit

 

History

History
30 lines (23 loc) · 858 Bytes

README.md

File metadata and controls

30 lines (23 loc) · 858 Bytes

Dependency Status License

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
  }
});