Login doesn't work on mobile devices but works on desktops
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:
- Login on a computer works
- Login on any mobile device is sending you to the error login page
- 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
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!
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);
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.
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.
I'm facing the same issue with iOS devices when running the app locally. (using http and localhost).