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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.7.5, 2.8.2, 2.9
    • Fix Version/s: 2.7.6, 2.8.4
    • Component/s: Badges
    • Labels:
    • Affected Branches:
      MOODLE_27_STABLE, MOODLE_28_STABLE, MOODLE_29_STABLE
    • Fixed Branches:
      MOODLE_27_STABLE, MOODLE_28_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-49170_master
    • Testing Instructions:
      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.

      Description

      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'] : '';
      

        Attachments

          Activity

            People

            Assignee:
            ybozhko Yuliya Bozhko
            Reporter:
            olga_ Olli Puurunen
            Peer reviewer:
            Petr Skoda Petr Skoda
            Integrator:
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Tester:
            Simey Lameze Simey Lameze
            Participants:
            Component watchers:
            Yuliya Bozhko, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              9/Mar/15