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

Mobile app requests fail because moodle doesn't send CORS header



      I've also reported this to Moodle project on MDL-69203 since the change will need to happen in Moodle.

      Tested on https://school.moodledemo.net and the latest 3.9 moodle app.

      With the latest update to the Moodle app it now respects CORS headers, these are sent on web service requests but not on the requests made under admin/tool/mobile/ directory and /lib/ajax/service.php file.
      This causes SSO login to not be made available as a choice as it can't make the initial requests.

      Here's an example:

      07-06 08:35:49.398 14884 14884 D SystemWebChromeClient: http://localhost/: Line 0 : Access to XMLHttpRequest at 'https://school.moodledemo.net/lib/ajax/service.php?info=tool_mobile_get_public_config' from origin 'http://localhost' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

      Steps to reproduce:

      1. Download official moodle app
      2. Connect to device with adb logcat
      3. Configure site to be school.moodledemo.net
      4. Close and reopen app
      5. Look in logcat to see failing requests

            Unassigned Unassigned
            alexmorris Alexander Morris
            1 Vote for this issue
            7 Start watching this issue


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