Unable to log in with IDP that uses 2FA due to app switch

Hi, I’m using react-native-auth0 version 1.6.0 on a React Native app compiled to iOS (13.2).

We are trying to log in via our corporate ADFS provider. This works perfectly well on the iOS Simulator and on iOS devices that are on our corporate network, but for off-network devices, we require two-factor authentication via the Microsoft Authenticator app.

The problem is that post-ADFS login, the user switches to the Authenticator app to approve the request, but when we return to our app that’s using react-native-auth0, we see a “Safari cannot open the page because the network connection was lost” message in the auth flow’s view controller. Reloading has no effect and the cycle simply repeats if I try again.

Is there a way to prevent iOS from closing the network connections in the (presumably) SFSafariViewController that is handling the authentication request, or short of that, are there any workarounds you can suggest? Thank you! I’m happy to post a GitHub issue on this as well if necessary.

Here is a related issue with the react-native-app-auth library, which does something similar. Note the suggested fix attached to the end of the issue: Two-factor authentication that requires user to switch to different app fails on iOS13. · Issue #414 · FormidableLabs/react-native-app-auth · GitHub

Opened #256: keep auth network connection open by pcurc · Pull Request #257 · auth0/react-native-auth0 · GitHub to address this.