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

OAuth2 login page does not set context and page url causing debugging messages

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.9.3, 3.10
    • 3.9.4, 3.10.1
    • Authentication
    • MOODLE_310_STABLE, MOODLE_39_STABLE
    • MOODLE_310_STABLE, MOODLE_39_STABLE
    • MDL-70242-master
    • Hide

      I think it's an overkill to ask tester to try to reproduce the whole problem (setup oAuth2, write event observer, etc), so here is a small workaround.

      1. Modify the file auth/oauth2/login.php and insert a line

      echo format_string($SITE->fullname);exit;
      

      before require_sesskey();

      2. Open this page in the browser ( http://sitename/auth/oauth2/login.php?id=1 ) and make sure that the site name is displayed and there are no debugging messages

      Show
      I think it's an overkill to ask tester to try to reproduce the whole problem (setup oAuth2, write event observer, etc), so here is a small workaround. 1. Modify the file auth/oauth2/login.php and insert a line echo format_string($SITE->fullname);exit; before require_sesskey(); 2. Open this page in the browser ( http://sitename/auth/oauth2/login.php?id=1 ) and make sure that the site name is displayed and there are no debugging messages

    Description

      1. Create an event listener to the user_created event that sends an email using email_to_user() function
      2. Set up oAuth2 login
      3. Login as a new user
      4. You will see debugging messages that the page context is not set, etc.

      email_to_user() expects the page context and url to be set but the auth/oauth2/login.php page does not set them. Normally it immediately redirects and it is not important, however the event observers may experience problems

      Attachments

        Activity

          People

            marina Marina Glancy
            marina Marina Glancy
            Ruslan Kabalin Ruslan Kabalin
            Andrew Lyons Andrew Lyons
            Janelle Barcega Janelle Barcega
            Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Sujith Haridasan
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              18/Jan/21

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour, 56 minutes
                1h 56m