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 popup not working on mobile Edge #7230

Closed
2 tasks
jkytomak opened this issue Jul 31, 2024 · 3 comments
Closed
2 tasks

Login popup not working on mobile Edge #7230

jkytomak opened this issue Jul 31, 2024 · 3 comments
Labels
bug-unconfirmed A reported bug that needs to be investigated and confirmed msal-browser Related to msal-browser package public-client Issues regarding PublicClientApplications question Customer is asking for a clarification, use case or information.

Comments

@jkytomak
Copy link

jkytomak commented Jul 31, 2024

Core Library

MSAL.js (@azure/msal-browser)

Core Library Version

3.17.0

Wrapper Library

Not Applicable

Wrapper Library Version

None

Public or Confidential Client?

Public

Description

Mobile Edge browser ends on redirectUrl page after logging with popup.
All other browser work fine (for example Edge on desktop and Chrome on mobile).

Error Message

user_cancelled: User cancelled the flow
and
invalid_client: Authentication failed

MSAL Logs

I was not able to get trace logs from mobile Edge, but you can try the issue by yourself:
https://my.humbol.app

Here is console log (about:inspect) from mobile Edge:

https://my.humbol.app/login?page=%2F

LOG2024-07-31T18:07:09.140Z INFO: Started new session ({"environment":"production","sessionId":"528bceb856a0a3925b34a3833f953348d567fd1e","serverVersion":"v2024.7.31-2"})
LOG2024-07-31T18:07:11.230Z INFO: Failed to sign in with Microsoft ("BrowserAuthError: user_cancelled: User cancelled the flow.")

https://my.humbol.app/login/ms-redirect#error=invalid_client&error_description=AADSTS50012%3a+Authentication+failed.+Trace+ID%3a+769b89c3-269d-47b8-a497-270f09a22700+Correlation+ID%3a+019109f9-79ec-752f-bdf6-429df94e2d6f+Timestamp%3a+2024-07-31+18%3a07%3a14Z&error_uri=https%3a%2f%2flogin.microsoftonline.com%2ferror%3fcode%3d50012&state=eyJpZCI6IjAxOTEwOWY5LTdhMTUtNzAxMS04MGYyLTI5MDFmZjZkYmRlZiIsIm1ldGEiOnsiaW50ZXJhY3Rpb25UeXBlIjoicG9wdXAifX0%3d

LOG2024-07-31T18:07:14.439Z INFO: Get new client token
LOG2024-07-31T18:07:14.499Z INFO: Started new session ({"environment":"production","sessionId":"8c4765ea19d38ae8042e4599afbd055d5e3bcae4","serverVersion":"v2024.7.31-2"})

Network Trace (Preferrably Fiddler)

  • Sent
  • Pending

MSAL Configuration

{
  auth: { clientId: 'd29e5778-18e9-4dae-9ecf-078d0168fe86' },
  cache: {
      cacheLocation: 'localStorage'
  }
}

Relevant Code Snippets

publicClientApplication.loginPopup({
scopes:  ['User.read'],
prompt: 'select_account',
redirectUri: '/login/ms-redirect',
}

Reproduction Steps

Go to https://my.humbol.app with mobile Edge
Click "Sign in with Microsoft"
Try to login with any MS account.
End up on ms-redirect page open and original login page saying that login failed.

Expected Behavior

Popup is closed and original login page is logged in to app (if valid Humbol user) or saying "Currently only open for invited users" (if not Humbol user).

Identity Provider

Entra ID (formerly Azure AD) / MSA

Browsers Affected (Select all that apply)

Edge

Regression

No response

Source

External (Customer)

@jkytomak jkytomak added bug-unconfirmed A reported bug that needs to be investigated and confirmed question Customer is asking for a clarification, use case or information. labels Jul 31, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs: Attention 👋 Awaiting response from the MSAL.js team label Jul 31, 2024
@github-actions github-actions bot added msal-browser Related to msal-browser package public-client Issues regarding PublicClientApplications labels Jul 31, 2024
@lalimasharda
Copy link
Contributor

Hey @jkytomak the error indicates that the popup was closed by the user or it could be blocked by the browser. When I try to repro the issue, I see a new tab open to enter my credentials. Can you confirm if this tab is opening for you? If not, you need to check if it is being blocked by the browser.

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs: Author Feedback Awaiting response from issue author and removed Needs: Attention 👋 Awaiting response from the MSAL.js team labels Aug 5, 2024
@jkytomak
Copy link
Author

jkytomak commented Aug 7, 2024

@lalimasharda yes, popup opens normally, but after I select / login with some account from popup, it does not close and those errors come to console / api.

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs: Attention 👋 Awaiting response from the MSAL.js team and removed Needs: Author Feedback Awaiting response from issue author labels Aug 7, 2024
@tnorling
Copy link
Collaborator

tnorling commented Aug 7, 2024

Please see here - popup is not recommended in mobile browsers as support is very limited. What Edge is doing here is "closing" the popup and then re-opening the url in a new tab which causes the original calling page to lose the reference to the frame doing the sign-in. We recommend using redirects for interaction in mobile browsers

@tnorling tnorling closed this as completed Aug 7, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot removed the Needs: Attention 👋 Awaiting response from the MSAL.js team label Aug 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-unconfirmed A reported bug that needs to be investigated and confirmed msal-browser Related to msal-browser package public-client Issues regarding PublicClientApplications question Customer is asking for a clarification, use case or information.
Projects
None yet
Development

No branches or pull requests

3 participants