Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Facebook Limited Login not workind due to incorrect domain in JWT validation #9120

Merged
merged 2 commits into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions spec/AuthenticationAdapters.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2081,7 +2081,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 @@ -2145,7 +2145,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 @@ -2172,7 +2172,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 @@ -2199,7 +2199,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 @@ -2250,7 +2250,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 @@ -2286,7 +2286,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 @@ -2320,7 +2320,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 @@ -2378,7 +2378,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 @@ -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;
Expand Down
Loading