Uploaded image for project: 'Moodle app'
  1. Moodle app
  2. MOBILE-4572

Android: Race condition when using SSO login in browser and a fixed site

Details

    • Bug
    • Resolution: Unresolved
    • Critical
    • None
    • 4.3.0
    • Authentication
    • Hide

      This issue only needs to be tested in Android.

      This issue isn't easy to test because, since it was a race condition, the problem only happened some times.

      1. Login in a site using browser authentication. The authentication should work properly in the app.
      Show
      This issue only needs to be tested in Android. This issue isn't easy to test because, since it was a race condition, the problem only happened some times. Login in a site using browser authentication. The authentication should work properly in the app.
    • MOODLE_403_STABLE
    • Moodle Apps - 2024 i1.4, Moodle Apps - 2024 i2, Moodle Apps - 2024 i2.1

    Description

      We have a race condition when using SSO in an app that has a single fixed site:

      1. The app opens for the first time, it detects it uses a single site so it opens credentials screen.
      2. 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.
      3. When the user logins in the browser, the app is launched.
      4. 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.

      Attachments

        Activity

          People

            dpalou Dani Palou
            dpalou Dani Palou
            Pau Ferrer Pau Ferrer
            Juan Leyva Juan Leyva
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Clockify

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.