-
Bug
-
Resolution: Done
-
Critical
-
4.3.0
-
-
MOODLE_403_STABLE
-
MOODLE_404_STABLE
-
Moodle Apps - 2024 i1.4, Moodle Apps - 2024 i2, Moodle Apps - 2024 i2.1
We have a race condition when using SSO in an app that has a single fixed site:
- The app opens for the first time, it detects it uses a single site so it opens credentials screen.
- Credentials screen detects the site uses SSO and, if CoreLoginHelper.shouldSkipCredentialsScreenOnSSO() is true, it opens the browser and kills the app. In iOS the app isn't killed so this problem doesn't happen.
- When the user logins in the browser, the app is launched.
- The app starts the authentication in the background. At the same time, the app repeats steps 1&2. If the app opens the browser before the authentication is done, the authentication doesn't finish because the app is killed. There is a race condition.
One possible solution is not killing the app when opening the browser. However, if the OS kills the app for some reason we will have the same problem.
Since we cannot be sure if handleOpenURL will be triggered before the browser is launched or not (it should, but we cannot be 100% sure), another solution would be to store some flag in DB or local storage when the app launches the browser, and avoid launching the browser automatically again the next times the app is opened in a certain time.
- caused a regression
-
MOBILE-4671 When launching the app on iOS, the in-app browser does not automatically launch
-
- Tested
-