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

Login via social login with getWithPopup failing on Facebooks MFA request #1532

Open
BillRamsey-minted opened this issue Aug 14, 2024 · 0 comments
Labels

Comments

@BillRamsey-minted
Copy link

Describe the bug

We use this library for allowing users to login via Facebook.

The code looks something like this:

return oktaAuthClient.token
    .getWithPopup({
      display: 'popup',
      idp: facebookIdp,
      prompt: 'login',
      redirectUri: `${window.location.origin}${redirectUri}`,
      responseType: 'id_token',
    });

This has worked for years correctly. However, now when Facebook asks for your MFA code, the main window throws an error:

getToken.js:88 Uncaught (in promise) AuthSdkError: Unable to parse OAuth flow response
    at eval (getToken.js:88:1)

And when the client finally clicks to allow, upon returning to window it throws this error:

redirect?stateToken=02.id.X...K:39 Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://login.MYDOMAIN.net') does not match the recipient window's origin ('https://MY-TENANT.oktapreview.com').

If the user already has entered the MFA codes, this issue does not happen, and it returns to the window, and the user is logged in.

Reproduction Steps?

See description.

It seems the error is in getToken

              if (!popupWindow || popupWindow.closed) {
                clearInterval(closePoller);
                reject(new AuthSdkError('Unable to parse OAuth flow response'));
              }

I have added a breakpoint, and it is failing because the popupWindow is closed. Something about the Facebook mfa request is causing the sdk to think the popup window is closed.

SDK Versions

we are on version 7.7.0 of this library.

Additional Information?

I have reported this to okta support also, but they have not provided any info so far.

I am reporting to you since it does seem to be in this SDK's understanding of the popup window.

This changed within the last couple days with no change on our part.

If this is not an appropriate place for reporting this issue, please accept my apologies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant