Skip to content

Commit

Permalink
fix: Facebook Limited Login not working due to incorrect domain in JW…
Browse files Browse the repository at this point in the history
…T validation (#9122)
  • Loading branch information
chriscborg committed May 16, 2024
1 parent eba9dff commit 9d0bd2b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions spec/AuthenticationAdapters.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2047,7 +2047,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',
Expand Down Expand Up @@ -2097,7 +2097,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',
Expand All @@ -2117,7 +2117,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',
Expand All @@ -2137,7 +2137,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',
Expand Down Expand Up @@ -2174,7 +2174,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'
);
}
});
Expand Down Expand Up @@ -2203,7 +2203,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'
);
}
});
Expand All @@ -2230,7 +2230,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'
);
}
});
Expand Down Expand Up @@ -2288,7 +2288,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',
};
Expand Down
2 changes: 1 addition & 1 deletion src/Adapters/Auth/facebook.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,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;
Expand Down

0 comments on commit 9d0bd2b

Please sign in to comment.