Skip to content

Commit cac36cc

Browse files
author
David Lozano
authored
Merge pull request #9 from Telefonica/fix/removeKidRestriction
FIX issue
2 parents da71abe + 5cf034e commit cac36cc

File tree

3 files changed

+1
-17
lines changed

3 files changed

+1
-17
lines changed

lib/jwt-utils.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,6 @@ module.exports = function(configuration) {
147147

148148
var header = readJWTHeader(segments[0]);
149149

150-
if (!header.kid) {
151-
throw errors.MISSING_REQUIRED_KID();
152-
}
153-
154150
var algorithm = header.alg || 'HS256';
155151

156152
if (!hashAlgorithms[header.alg]) {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "jwt-utils",
33
"description": "JSON Web Tokens (JWT) utils",
4-
"version": "1.0.3",
4+
"version": "1.0.4",
55
"license": "Apache-2.0",
66
"author": {
77
"name": "Guido García Bernardo",

test/unit/jwt-utils-test.js

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -487,18 +487,6 @@ describe('Jwt Utils Tests', function() {
487487
});
488488
});
489489

490-
it('should fail to read an unencrypted token without kid', function() {
491-
var jwtToken = 'eyJhbGciOiJIUzI1NiJ9.eyJpc' +
492-
'3MiOiIiLCJqdGkiOiIiLCJpYXQiOjEzNzQwNzg4' +
493-
'NzF9.khagsjdgjas';
494-
495-
var hashKey = '11111111111111111111111111111111';
496-
jwtUtils.readJWT(jwtToken, hashKey, function(err, token) {
497-
expect(err).to.be.apiError(errors.MISSING_REQUIRED_KID());
498-
expect(token).not.to.exist;
499-
});
500-
});
501-
502490
it('should fail to read an unencrypted token without a valid algorithm', function() {
503491
var jwtToken = 'eyJhbGciOiJIUzI1NyIsICJraWQiOiJteUtpZCJ9.eyJpc' +
504492
'3MiOiIiLCJqdGkiOiIiLCJpYXQiOjEzNzQwNzg4' +

0 commit comments

Comments
 (0)