From f852040838e4ce421f350e6f0b34c4b4ef43f39b Mon Sep 17 00:00:00 2001 From: Chris Borg Date: Tue, 7 May 2024 08:58:37 +0200 Subject: [PATCH 1/2] fix: Changes facebook auth host to resolve JWT validation issue --- src/Adapters/Auth/facebook.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Adapters/Auth/facebook.js b/src/Adapters/Auth/facebook.js index 737657c8bd..871374de24 100644 --- a/src/Adapters/Auth/facebook.js +++ b/src/Adapters/Auth/facebook.js @@ -7,7 +7,7 @@ const jwt = require('jsonwebtoken'); const httpsRequest = require('./httpsRequest'); const authUtils = require('./utils'); -const TOKEN_ISSUER = 'https://facebook.com'; +const TOKEN_ISSUER = 'https://www.facebook.com'; function getAppSecretPath(authData, options = {}) { const appSecret = options.appSecret; From 38dda4dc8e8833c8ef0daf0d065b547b27174677 Mon Sep 17 00:00:00 2001 From: Chris Borg Date: Wed, 8 May 2024 10:20:24 +0200 Subject: [PATCH 2/2] fix: Changes facebook limited login host on unit tests --- spec/AuthenticationAdapters.spec.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/spec/AuthenticationAdapters.spec.js b/spec/AuthenticationAdapters.spec.js index 2a3472541e..14f85280a6 100644 --- a/spec/AuthenticationAdapters.spec.js +++ b/spec/AuthenticationAdapters.spec.js @@ -2029,7 +2029,7 @@ describe('facebook limited auth adapter', () => { it('should use algorithm from key header to verify id_token', async () => { const fakeClaim = { - iss: 'https://facebook.com', + iss: 'https://www.facebook.com', aud: 'secret', exp: Date.now(), sub: 'the_user_id', @@ -2093,7 +2093,7 @@ describe('facebook limited auth adapter', () => { it('(using client id as string) should verify id_token', async () => { const fakeClaim = { - iss: 'https://facebook.com', + iss: 'https://www.facebook.com', aud: 'secret', exp: Date.now(), sub: 'the_user_id', @@ -2120,7 +2120,7 @@ describe('facebook limited auth adapter', () => { it('(using client id as array) should verify id_token', async () => { const fakeClaim = { - iss: 'https://facebook.com', + iss: 'https://www.facebook.com', aud: 'secret', exp: Date.now(), sub: 'the_user_id', @@ -2147,7 +2147,7 @@ describe('facebook limited auth adapter', () => { it('(using client id as array with multiple items) should verify id_token', async () => { const fakeClaim = { - iss: 'https://facebook.com', + iss: 'https://www.facebook.com', aud: 'secret', exp: Date.now(), sub: 'the_user_id', @@ -2198,7 +2198,7 @@ describe('facebook limited auth adapter', () => { fail(); } catch (e) { expect(e.message).toBe( - 'id token not issued by correct OpenID provider - expected: https://facebook.com | from: https://not.facebook.com' + 'id token not issued by correct OpenID provider - expected: https://www.facebook.com | from: https://not.facebook.com' ); } }); @@ -2234,7 +2234,7 @@ describe('facebook limited auth adapter', () => { fail(); } catch (e) { expect(e.message).toBe( - 'id token not issued by correct OpenID provider - expected: https://facebook.com | from: https://not.facebook.com' + 'id token not issued by correct OpenID provider - expected: https://www.facebook.com | from: https://not.facebook.com' ); } }); @@ -2268,7 +2268,7 @@ describe('facebook limited auth adapter', () => { fail(); } catch (e) { expect(e.message).toBe( - 'id token not issued by correct OpenID provider - expected: https://facebook.com | from: https://not.facebook.com' + 'id token not issued by correct OpenID provider - expected: https://www.facebook.com | from: https://not.facebook.com' ); } }); @@ -2326,7 +2326,7 @@ describe('facebook limited auth adapter', () => { it('should throw error with with invalid user id', async () => { const fakeClaim = { - iss: 'https://facebook.com', + iss: 'https://www.facebook.com', aud: 'invalid_client_id', sub: 'a_different_user_id', };