diff --git a/lib/jwt-utils.js b/lib/jwt-utils.js index 13dcbab..f597730 100644 --- a/lib/jwt-utils.js +++ b/lib/jwt-utils.js @@ -147,10 +147,6 @@ module.exports = function(configuration) { var header = readJWTHeader(segments[0]); - if (!header.kid) { - throw errors.MISSING_REQUIRED_KID(); - } - var algorithm = header.alg || 'HS256'; if (!hashAlgorithms[header.alg]) { diff --git a/package.json b/package.json index e863c5f..aa62287 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "jwt-utils", "description": "JSON Web Tokens (JWT) utils", - "version": "1.0.3", + "version": "1.0.4", "license": "Apache-2.0", "author": { "name": "Guido GarcĂ­a Bernardo", diff --git a/test/unit/jwt-utils-test.js b/test/unit/jwt-utils-test.js index 7b0b5ed..3bff0f3 100644 --- a/test/unit/jwt-utils-test.js +++ b/test/unit/jwt-utils-test.js @@ -487,18 +487,6 @@ describe('Jwt Utils Tests', function() { }); }); - it('should fail to read an unencrypted token without kid', function() { - var jwtToken = 'eyJhbGciOiJIUzI1NiJ9.eyJpc' + - '3MiOiIiLCJqdGkiOiIiLCJpYXQiOjEzNzQwNzg4' + - 'NzF9.khagsjdgjas'; - - var hashKey = '11111111111111111111111111111111'; - jwtUtils.readJWT(jwtToken, hashKey, function(err, token) { - expect(err).to.be.apiError(errors.MISSING_REQUIRED_KID()); - expect(token).not.to.exist; - }); - }); - it('should fail to read an unencrypted token without a valid algorithm', function() { var jwtToken = 'eyJhbGciOiJIUzI1NyIsICJraWQiOiJteUtpZCJ9.eyJpc' + '3MiOiIiLCJqdGkiOiIiLCJpYXQiOjEzNzQwNzg4' +