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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.8.5, 3.9.2
    • Fix Version/s: 3.8.6, 3.9.3
    • Component/s: Web Services
    • Labels:
    • Testing Instructions:
      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'
    • Affected Branches:
      MOODLE_38_STABLE, MOODLE_39_STABLE
    • Fixed Branches:
      MOODLE_38_STABLE, MOODLE_39_STABLE
    • Pull 3.8 Branch:
      MDL-69759-m38
    • Pull 3.9 Branch:
      MDL-69759-m39
    • Pull 3.10 Branch:
      MDL-69759-m310
    • Pull Master Branch:
      MDL-69759-master

      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

              Assignee:
              quen Sam Marshall
              Reporter:
              quen Sam Marshall
              Peer reviewer:
              Sara Arjona (@sarjona)
              Integrator:
              Víctor Déniz Falcón
              Tester:
              Janelle Barcega
              Participants:
              Component watchers:
              Juan Leyva, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                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