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

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

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.8.5, 3.9.2
    • 3.8.6, 3.9.3
    • Web Services
    • MOODLE_38_STABLE, MOODLE_39_STABLE
    • MOODLE_38_STABLE, MOODLE_39_STABLE
    • MDL-69759-m39
    • 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'

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

              quen Sam Marshall
              quen Sam Marshall
              Sara Arjona (@sarjona) Sara Arjona (@sarjona)
              Víctor Déniz Falcón Víctor Déniz Falcón
              Janelle Barcega Janelle Barcega
              Juan Leyva, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Laurent David, Sara Arjona (@sarjona)
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                9/Nov/20

                Time Tracking

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