react-aad icon indicating copy to clipboard operation
react-aad copied to clipboard

Login doesn't work on mobile devices but works on desktops

Open KonstantinDinev opened this issue 6 years ago • 5 comments

Describe the bug Login procedure works well on any desktop or laptop machine but fails on tablets or phones.

To Reproduce Steps to reproduce the behavior:

  1. Login on a computer works
  2. Login on any mobile device is sending you to the error login page
  3. In authProvider the loginType is set to Redirect instead of Popup

Expected behavior To log to the web application on a mobile the same way as log on a computer.

Desktop (please complete the following information):

  • MacOS Mojave or Windows 10
  • Chrome, Safari
  • latest

Smartphone (please complete the following information):

  • iPad, iOS
  • iOS 12.4
  • Chrome, Safari
  • Mobile

KonstantinDinev avatar Nov 28 '19 08:11 KonstantinDinev

Can you see what error is being raised? And which version of the library are you using? Please also share what your configuration options look like. Thanks!

AndrewCraswell avatar Dec 03 '19 01:12 AndrewCraswell

Hi @AndrewCraswell! The error that I'm receiving on any mobile device while logging is: ClientAuthError: Token renewal operation failed due to timeout! It's strange because I'm only receiving this on a mobile device.

Library: "react-aad-msal": "^1.0.4", Platform: iOS 12.4.3 - iPad Air Browser: Chrome, Version 77.0.3865.103

import { MsalAuthProvider, LoginType } from 'react-aad-msal';
import Constants from '../api/constants';

const config = {
  auth: {
    authority:   Constants.AZURE_AD.authority,
    clientId:    Constants.AZURE_AD.clientId,
    redirectUri: Constants.SYSTEM.frontend /*window.location.origin*/,
    postLogoutRedirectUri: Constants.SYSTEM.frontend,
 // validateAuthority: true,

    navigagteToLoginRequestUrl: true
  },
  cache: {
    cacheLocation: "localStorage",
    storeAuthStateInCookie: true
  }
};

const authenticationParameters = {
  scopes: ['openid']
}

export const authProvider = new MsalAuthProvider(config, authenticationParameters, LoginType.Redirect);

KonstantinDinev avatar Dec 03 '19 12:12 KonstantinDinev

Can you try using the latest version? There's a few breaking changes that you will likely need to update, but there were fix.

You should also use the latest version of MSAL (1.2.0-beta.5) as they have applied fixes for some of these issues.

AndrewCraswell avatar Dec 10 '19 20:12 AndrewCraswell

Hi @AndrewCraswell, I've updated to the latest version of MSAL 1.2.0 and I've managed to log in from Android phone using a Chrome browser. The problem still persists on iOS mobile devices and the error message that I'm receiving now is: ClientAuthError: Login_In_Progress: Error during login call - login is already in progress.

Any further help would be appreciated.

KonstantinDinev avatar Dec 12 '19 12:12 KonstantinDinev

I'm facing the same issue with iOS devices when running the app locally. (using http and localhost).

nairmanu avatar May 01 '20 23:05 nairmanu