Skip to content

Commit

Permalink
Add support for including kid in header.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredhanson committed Sep 4, 2014
1 parent 182e799 commit 7d73cc2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/encode/sat.js
Expand Up @@ -13,6 +13,7 @@ module.exports = function(options) {

var issuer = options.issuer
, key = options.key
, kid = options.kid
, algorithm = options.algorithm || 'RS256';

if (!issuer) { throw new TypeError('SAT encoding requires an issuer'); }
Expand Down Expand Up @@ -42,7 +43,7 @@ module.exports = function(options) {
claims.exp = Math.floor(val.getTime() / 1000);
}

var header = { typ: 'JWT', alg: algorithm};
var header = { typ: 'JWT', alg: algorithm, kid: kid };
try{
var token = jws.sign({ header: header, payload: claims, secret: key });
}catch(ex){
Expand Down

0 comments on commit 7d73cc2

Please sign in to comment.