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

Oauth2 Issuer - guess_image() accesses undefined property 'discoveryurl'

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.3.1
    • Fix Version/s: 3.3.2
    • Component/s: Authentication
    • Labels:
    • Testing Instructions:
      Hide

      Create a new issuer through the administration site with the following parameters (OpenId Connect Test server):

         Name: Test

         Client ID: user

         Client Secret: password

         Service base URL: https://mitreid.org/

      Leave the reset as it is. Logo URL must be empty!

      The issuer should be saved without an error. (Currently the Error from the Description is thrown)

      Unfortunately, the test server above has no favicon.ico. However, the error when creating the issue is gone.

       

      Show
      Create a new issuer through the administration site with the following parameters (OpenId Connect Test server):    Name: Test    Client ID: user    Client Secret: password    Service base URL: https://mitreid.org/ Leave the reset as it is. Logo URL must be empty! The issuer should be saved without an error. (Currently the Error from the Description is thrown) Unfortunately, the test server above has no favicon.ico. However, the error when creating the issue is gone.  
    • Workaround:
      Hide

      Specify a Logo URL

      Show
      Specify a Logo URL
    • Affected Branches:
      MOODLE_33_STABLE
    • Fixed Branches:
      MOODLE_33_STABLE
    • Pull Master Branch:
      MDL-59539-master

      Description

      In the function guess_image() of the lib/classes/oauth2/api.php:350 there is a call to get the property 'discoveryurl' of an issuer. However, this property is never defined for an issuer and therefore throws the exception:

      coding_exception: Coding error detected, it must be fixed by a programmer: Unexpected property 'discoveryurl' requested

      This problem does not occur in core, since all predefined issuers have already a predefined image. So this code within

      if (empty($issuer->get('image'))) {
      

      is never called.

        Attachments

          Activity

            People

            • Votes:
              3 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                11/Sep/17