Login process gets interrupted when using the home button to switch apps
See original GitHub issueISSUE CASE 1 Case 2 here
General info
In our React Native project, we use the the react-native-app-auth
version 6.0.2. We begin the authorization process with something like the following:
reactNativeAuthorize({
issuer: BASE_API_URL,
clientId: "our-client-id",
redirectUrl: "ourapp://callback",
scopes: ["offline", "openid", "create:payments", "read:accounts"]
});
This opens a login flow in browser. As a part of the login flow, the user will be redirected to the login page of their chosen bank account. Most banks nowadays require the use of a separate login app which means that in order to complete the login flow the user must leave our application, open the separate login app, enter their PIN code or use finger print recognition and navigate back to our application.
The flow works well on iPhone. It usually works well on Android, but we have noticed two cases where the login process repeatedly fails with a consistent outcome when following certain steps.
Case 1
When the user navigates to the login app by using the Android home key instead of the app switcher key, this causes the login flow to get canceled. When returning back to the application, the user is faced with a login cancelation popup.
We are wondering if this is something inherent to Android that we should just communicate better to our users (effectively tell them not to use the home button during login) or if this could be fixed either to this library or to our login process.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5
Top GitHub Comments
You are not the first dev describing something similar #480 . Unfortunately it’s not something we can replicate. Is there a particular OS vendor, launcher combo giving you this issue or is it consistent across the board?
On Android when backgrounding an app the activity may be destroyed but in testing this state restoration works fine. The app resources are only collected if you’re lacking available memory so switching to a 2FA app and back shouldn’t trigger this behavior (unless you’ve enabled a developer flag that doesn’t keep your activities)
If this is not your case then the only other explanation is around how your app operates. Quickly looking at the reactive native module there doesn’t seem any issue with the implementation. At most you should see a browser refresh when coming back if any.
Also please note you’ll need to update the lib version inside the reactive native module uses to something closer to top of tree via https://jitpack.io/#openid/AppAuth-Android to make it work on the latest OS versions.
Took me a while to get back to this and I’m happy I did as I wasn’t aware of this issue. Closing as it seems there is nothing further to discuss at this point in time.