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

Web service get_active_tokens doesn't return those without expiry date

    XMLWordPrintable

Details

    • MOODLE_310_STABLE, MOODLE_311_STABLE, MOODLE_400_STABLE
    • MOODLE_310_STABLE, MOODLE_311_STABLE
    • MDL-72464-311
    • Hide

      Manual

      1. Login as admin
      2. Navigate to Server > Web services > Manage tokens in site administration
      3. Create a token for yourself
        • Note: leave the Valid until field disabled
      4. Select Profile from the user menu
      5. Click Edit profile
      6. Confirm that the Sign out everywhere form element is present

      Automated

      $ vendor/bin/phpunit --testsuite core_webservice_testsuite --filter webservice_test
      

      Show
      Manual Login as admin Navigate to Server > Web services > Manage tokens in site administration Create a token for yourself Note : leave the Valid until field disabled Select Profile from the user menu Click Edit profile Confirm that the Sign out everywhere form element is present Automated $ vendor/bin/phpunit --testsuite core_webservice_testsuite --filter webservice_test

    Description

      When I create a webservice token without an expiry date, it records validuntil = 0 in the tokens table:

      However the method for retrieving them only considers NULL as non-expiring tokens: https://github.com/moodle/moodle/blob/443a980aea0dcd12d4eb3ba69bc0347b43acb665/webservice/lib.php#L864

      This means when admin changes a user password, they aren't prompted to Sign out everywhere for the user (found while looking at MDL-72462)

      Attachments

        Issue Links

          Activity

            People

              pholden Paul Holden
              pholden Paul Holden
              Simey Lameze Simey Lameze
              Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
              CiBoT CiBoT
              Juan Leyva, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Laurent David, Raquel Ortega, Sara Arjona (@sarjona)
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                8/Nov/21

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 2 hours, 36 minutes
                  2h 36m