iosreact-nativeazure-active-directorysingle-sign-onazure-ad-msal

React Native MSAL - SSO does not work from Native to Web - iOS


We are developing two new react native apps, and need to integrate Azure AD authentication at both the places. We also have existing web apps that are Azure AD enabled and the user can open the web links from our (new) native apps.

We have decided to use MSAL library (react-native-msal) to implement the authentication part mainly to support SSO between the native apps + the web apps that we open in the Safari browser.

We have followed all the steps that the react-native-msal library suggests and are able to achieve SSO between the two native apps.

However, when I login to one native app, and try to open the web app link using react linking, the web app prompts for the login credentials.

Note: For authenticating user through native app, we are using "Authentication Session" with "prefersEphemeralWebBrowserSession = false" which ideally should share the SSO cookies with the Safari browser.

But clearly, this does not seem to work.

I would like to get some understanding on this problem and find out if others are facing this issue too? or is it just us?


Solution

  • Well, it turns out to be a problem with the simulator. This functionality works only on the physical devices (iPhone/iPad) and not on the simulators.

    This should have been documented in the react-native-msal's document though.