Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-69759

Web services: app checks to token.php cause errors in log

XMLWordPrintable

    • MOODLE_38_STABLE, MOODLE_39_STABLE
    • MOODLE_38_STABLE, MOODLE_39_STABLE
    • MDL-69759-master
    • Hide
      1. Disable web services in your server (set 'enablewebservices' config checkbox off, it's under 'Advanced features' in the admin settings).
      2. In your browser, visit the URL /login/token.php?appsitecheck=1
        • EXPECTED: An error should be reported in JSON format, 'Web services must be enabled in Advanced features'
      3. Enable web services in your server (set the checkbox on),
      4. In your browser, visit the URL /login/token.php?appsitecheck=1
        • EXPECTED: You should see a JSON response with appsitecheck "ok".

      Only if you have a version of the mobile app/Moodle Desktop with MOBILE-3556 applied, then you can also do this test:

      1. Start the mobile app with no data (the easiest way to do this is using Moodle Desktop, open developer tools, then go to the Application tab and clear storage, then press F5 to reload).
      2. Click 'I'm a learner' and type or paste in the URL to your site, then select it to proceed to the login screen. (You do not need to actually log in but you should see the login/password fields.)
        • EXPECTED: You get to the login screen without error.
      3. Examine the web server error log for your Moodle server, looking for errors at the time that you did the login.
        • EXPECTED: There are no errors at that time. Specifically, there is no error like the following: 'Default exception handler: A required parameter (username) was missing'
      Show
      Disable web services in your server (set 'enablewebservices' config checkbox off, it's under 'Advanced features' in the admin settings). In your browser, visit the URL /login/token.php?appsitecheck=1 EXPECTED: An error should be reported in JSON format, 'Web services must be enabled in Advanced features' Enable web services in your server (set the checkbox on), In your browser, visit the URL /login/token.php?appsitecheck=1 EXPECTED: You should see a JSON response with appsitecheck "ok". Only if you have a version of the mobile app/Moodle Desktop with MOBILE-3556 applied, then you can also do this test: Start the mobile app with no data (the easiest way to do this is using Moodle Desktop, open developer tools, then go to the Application tab and clear storage, then press F5 to reload). Click 'I'm a learner' and type or paste in the URL to your site, then select it to proceed to the login screen. (You do not need to actually log in but you should see the login/password fields.) EXPECTED: You get to the login screen without error. Examine the web server error log for your Moodle server, looking for errors at the time that you did the login. EXPECTED: There are no errors at that time. Specifically, there is no error like the following: 'Default exception handler: A required parameter (username) was missing'

      When a user logs into the mobile app, it checks the server by making a call to /login/token.php. This causes errors in the log because required parameters are not supplied.

      I am proposing that the app passes a special parameter to be used only for this purpose, which would then cause the script to exit before the required parameter checks.

      For more detail, see MOBILE-3556.

            quen Sam Marshall
            quen Sam Marshall
            Sara Arjona (@sarjona) Sara Arjona (@sarjona)
            Victor Déniz Falcón Victor Déniz Falcón
            Janelle Barcega Janelle Barcega
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 3 hours, 20 minutes
                3h 20m

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