Skip to content

Conversation

@georgeloring
Copy link

Fixes #414

Description

Adding a call to beginBackgroundTaskWithExpirationHandler before presenting AsWebAuthenticationSession control so that if a network request is in progress in iOS13 and the app is put into the background, the network request is not killed right away. Background task will still be expired if takes too long or directly expired when the authentication session completes.

Steps to verify

See video links from bug report. With a long-running network request in AsWebAuthenticationSession put the app in the background and then resume. With this fix, the network request is still intact.

@kadikraman kadikraman merged commit 1e0d420 into FormidableLabs:master Jan 6, 2020
@kadikraman
Copy link
Contributor

Released in v5.0.0 🎉

@TheMatrixMaster
Copy link

Description

This issue still persists on iOS14. We are using the latest react-native-app-auth version (v6.2.0). Following a standard Azure Active Directory v2 authentication request, the user leaves our app to validate two-factor authentication in Microsoft Authenticator app. This will resolve the request and return the appropriate access tokens which we then want to send to our server. However, the network request that gets created when the app is in the background gets killed immediately instead of staying intact until the user re-accesses the app.

Verification

This video link shows the described behaviour above.
https://drive.google.com/file/d/1LMs6t76iSaTyu4vdR5Gk5ZqaKsjwJCEe/view?usp=sharing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Two-factor authentication that requires user to switch to different app fails on iOS13.

3 participants