Skip to content

Commit 9d0bd2b

Browse files
authored
fix: Facebook Limited Login not working due to incorrect domain in JWT validation (#9122)
1 parent eba9dff commit 9d0bd2b

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

spec/AuthenticationAdapters.spec.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -2047,7 +2047,7 @@ describe('facebook limited auth adapter', () => {
20472047

20482048
it('should use algorithm from key header to verify id_token', async () => {
20492049
const fakeClaim = {
2050-
iss: 'https://facebook.com',
2050+
iss: 'https://www.facebook.com',
20512051
aud: 'secret',
20522052
exp: Date.now(),
20532053
sub: 'the_user_id',
@@ -2097,7 +2097,7 @@ describe('facebook limited auth adapter', () => {
20972097

20982098
it('(using client id as string) should verify id_token', async () => {
20992099
const fakeClaim = {
2100-
iss: 'https://facebook.com',
2100+
iss: 'https://www.facebook.com',
21012101
aud: 'secret',
21022102
exp: Date.now(),
21032103
sub: 'the_user_id',
@@ -2117,7 +2117,7 @@ describe('facebook limited auth adapter', () => {
21172117

21182118
it('(using client id as array) should verify id_token', async () => {
21192119
const fakeClaim = {
2120-
iss: 'https://facebook.com',
2120+
iss: 'https://www.facebook.com',
21212121
aud: 'secret',
21222122
exp: Date.now(),
21232123
sub: 'the_user_id',
@@ -2137,7 +2137,7 @@ describe('facebook limited auth adapter', () => {
21372137

21382138
it('(using client id as array with multiple items) should verify id_token', async () => {
21392139
const fakeClaim = {
2140-
iss: 'https://facebook.com',
2140+
iss: 'https://www.facebook.com',
21412141
aud: 'secret',
21422142
exp: Date.now(),
21432143
sub: 'the_user_id',
@@ -2174,7 +2174,7 @@ describe('facebook limited auth adapter', () => {
21742174
fail();
21752175
} catch (e) {
21762176
expect(e.message).toBe(
2177-
'id token not issued by correct OpenID provider - expected: https://facebook.com | from: https://not.facebook.com'
2177+
'id token not issued by correct OpenID provider - expected: https://www.facebook.com | from: https://not.facebook.com'
21782178
);
21792179
}
21802180
});
@@ -2203,7 +2203,7 @@ describe('facebook limited auth adapter', () => {
22032203
fail();
22042204
} catch (e) {
22052205
expect(e.message).toBe(
2206-
'id token not issued by correct OpenID provider - expected: https://facebook.com | from: https://not.facebook.com'
2206+
'id token not issued by correct OpenID provider - expected: https://www.facebook.com | from: https://not.facebook.com'
22072207
);
22082208
}
22092209
});
@@ -2230,7 +2230,7 @@ describe('facebook limited auth adapter', () => {
22302230
fail();
22312231
} catch (e) {
22322232
expect(e.message).toBe(
2233-
'id token not issued by correct OpenID provider - expected: https://facebook.com | from: https://not.facebook.com'
2233+
'id token not issued by correct OpenID provider - expected: https://www.facebook.com | from: https://not.facebook.com'
22342234
);
22352235
}
22362236
});
@@ -2288,7 +2288,7 @@ describe('facebook limited auth adapter', () => {
22882288

22892289
it('should throw error with with invalid user id', async () => {
22902290
const fakeClaim = {
2291-
iss: 'https://facebook.com',
2291+
iss: 'https://www.facebook.com',
22922292
aud: 'invalid_client_id',
22932293
sub: 'a_different_user_id',
22942294
};

src/Adapters/Auth/facebook.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const jwt = require('jsonwebtoken');
66
const httpsRequest = require('./httpsRequest');
77
const authUtils = require('./utils');
88

9-
const TOKEN_ISSUER = 'https://facebook.com';
9+
const TOKEN_ISSUER = 'https://www.facebook.com';
1010

1111
function getAppSecretPath(authData, options = {}) {
1212
const appSecret = options.appSecret;

0 commit comments

Comments
 (0)