microsoft-authentication-library-for-js: Login popup not working on mobile


  • msal@1.x.x or @azure/msal@1.x.x
  • @azure/msal-browser@2.3.1
  • @azure/msal-node@1.x.x
  • @azure/msal-react@1.x.x
  • @azure/msal-angular@0.x.x
  • @azure/msal-angular@1.x.x
  • @azure/msal-angular@2.x.x
  • @azure/msal-angularjs@1.x.x


  • Angular
  • React 16.13.1
  • Other


The calling the logging popup opens a new window, starts the logging process, and then stays on the new window and nothing hppens. On desktop/laptop it works fine.

Error Message

no error message

MSAL Configuration

import * as msal from '@azure/msal-browser'
const msalConfig = {
  auth: {
    clientId: process.env.REACT_APP_MICROSOFT_CLIENT_ID,
    redirectUri: window.location.origin,

const msalInstance = new msal.PublicClientApplication(msalConfig)

// inside async function
const response = await msalInstance.loginPopup({ scopes: [] })
console.log(response) // <-- this never gets called on mobile

Reproduction steps

Stated above

Expected behavior

Calling msalInstance.loginPopup should return info about the user and continue the execution flow

Identity Provider

  • Azure AD
  • Azure B2C Basic Policy
  • Azure B2C Custom Policy
  • ADFS
  • Other


  • Chrome
  • Firefox
  • Edge
  • Safari
  • IE
  • Other (Please add browser name here)


  • Did this behavior work before? no


  • Is this issue security related?
  • No


  • Internal (Microsoft)
  • Customer request

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 17 (4 by maintainers)

Most upvoted comments

@Gameboy98 did you find the solution? i am also facing issue while login to my app using mobile browser. I cant even see the redirection to microsoft login page while using chome without incognito in mobile browser. For desktop browser everything works fine

@egbertn I confirm that is working, with redirect instead of popups.

Code example:

At the end, it for now only can work with redirect login. The popup really does too much which not all browsers allow especially on the Mobile. My collegue finally got it working.

Still no solution? Has anyone managed to sort this out?

Indeed. Problematic

Still an issue

Still facing this issue, Please Refer This: const { instance } = useMsal(); instance .loginPopup(loginRequest) .then((res) => { localStorage.setItem(‘msToken’, JSON.stringify(res)) callMsGraph(res.accessToken).then((response) => { handleLogin(employee_code); }); // <-- This never gets called on Mobile Devices }) .catch((e) => { console.log(e); });