diff --git a/.circleci/config.yml b/.circleci/config.yml index dddc4f96..33790632 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2,7 +2,7 @@ version: 2 jobs: build: docker: - - image: circleci/node:10-browsers + - image: circleci/node:12-browsers environment: LANG: en_US.UTF-8 steps: diff --git a/lib/config.js b/lib/config.js index db3823d3..8f0d8070 100644 --- a/lib/config.js +++ b/lib/config.js @@ -126,7 +126,11 @@ const paramsSchema = Joi.object({ idpLogout: Joi.boolean() .optional() .default((parent) => parent.auth0Logout || false), - idTokenSigningAlg: Joi.string().not('none').optional().default('RS256'), + idTokenSigningAlg: Joi.string() + .insensitive() + .not('none') + .optional() + .default('RS256'), issuerBaseURL: Joi.string().uri().required(), legacySameSiteCookie: Joi.boolean().optional().default(true), authRequired: Joi.boolean().optional().default(true), diff --git a/test/config.tests.js b/test/config.tests.js index 3a3b5859..72904fca 100644 --- a/test/config.tests.js +++ b/test/config.tests.js @@ -371,15 +371,15 @@ describe('get config', () => { }); it('should not allow "none" for idTokenSigningAlg', () => { - const config = { - ...defaultConfig, - idTokenSigningAlg: 'none', - }; - assert.throws( - () => getConfig(config), - TypeError, - '"idTokenSigningAlg" contains an invalid value' - ); + let config = (idTokenSigningAlg) => + getConfig({ + ...defaultConfig, + idTokenSigningAlg, + }); + let expected = '"idTokenSigningAlg" contains an invalid value'; + assert.throws(() => config('none'), TypeError, expected); + assert.throws(() => config('NONE'), TypeError, expected); + assert.throws(() => config('noNE'), TypeError, expected); }); it('should require clientSecret for ID tokens with HMAC based algorithms', () => {