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

Persona verification in Badges, incorrect audience parameter when port is specified

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 2.7.6, 2.8.4
    • 2.7.5, 2.8.2, 2.9
    • Badges
    • MOODLE_27_STABLE, MOODLE_28_STABLE, MOODLE_29_STABLE
    • MOODLE_27_STABLE, MOODLE_28_STABLE
    • MDL-49170_master
    • Hide

      I guess the best way to test it is to use wwwroot that would have port in its URL (I personally haven't tested it).

      1. Test that you can still connect to Mozilla backpack without any issues.
      2. Test that you can push your earned badges from Moodle to Mozilla backpack.

      Show
      I guess the best way to test it is to use wwwroot that would have port in its URL (I personally haven't tested it). 1. Test that you can still connect to Mozilla backpack without any issues. 2. Test that you can push your earned badges from Moodle to Mozilla backpack.

      When connecting to Mozilla Backpack in /badges/backpackconnect.php, the assertion is verified using Mozilla Persona. However, if the port is specified in $CFG->wwwroot, the audience parameter is incorrect, because it is missing a colon.

      /badges/backpackconnect.php

      // Line 50
      $wwwparts = parse_url($CFG->wwwroot);
      $audience = $wwwparts['scheme'] . '://' . $wwwparts['host'];
      $audience .= isset($wwwparts['port']) ? $wwwparts['port'] : '';
      

      If $CFG->wwwroot is, for example, https://www.example.com:443, the $audience variable will be incorrectly https://www.example.com443. A simple fix:

      $audience .= isset($wwwparts['port']) ? ':' . $wwwparts['port'] : '';
      

            ybozhko Yuliya Bozhko
            olga_ Olli Puurunen
            Petr Skoda Petr Skoda
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Simey Lameze Simey Lameze
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

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