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

"auth_logo" in auth_cas and auth_shibboleth throw an invalidresponse exception when calling "tool_mobile_get_public_config"



    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 3.7.1, 3.7.2
    • Fix Version/s: None
    • Component/s: Authentication
    • Labels:


      This minor bug did break the login process of our Android and Windows Store mobile apps (not tested on iOS).

      When not using the auth_logo in CAS or Shibboleth authentication plugins, the standard /login/index.php page displays a broken icon on Firefox (see the attached "auth_logo_noimg_ff.png").

      On the other hand, when using an auth_logo in the CAS or Shibboleth plugin, the "tool_mobile_get_public_config" in /lib/ajax/service.php do throw an "invalidresponse" exception. Effectively preventing any user to connect to our server through the Android or Windows Store app.

      A small curl script demonstrates this situation :

      curl -s -H "Accept: application/json" -X POST --data-raw '[{"index":0,"methodname":"tool_mobile_get_public_config","args":[]}]' "http://my.moodle.com/lib/ajax/service.php?info=tool_mobile_get_public_config"

      Expected (truncated) output :

          "error": false,
          "data": {
            "wwwroot": "http://my.moodle.com",
            "httpswwwroot": "http://my.moodle.com",
            "identityproviders": [
                "name": "CAS",
                "iconurl": "http://my.moodle.com/pluginfile.php/1/auth_cas/logo/",
                "url": "http://my.moodle.com/login/index.php?authCAS=CAS"

      Got the following error :

          "error": true,
          "exception": {
            "message": "Invalid response value detected",
            "errorcode": "invalidresponse",
            "backtrace": "* line 442 of /lib/externallib.php: invalid_response_exception thrown\n* line 250 of /lib/externallib.php: call to external_api::clean_returnvalue()\n* line 59 of /lib/ajax/service.php: call to external_api::call_external_function()\n",
            "link": "http://my.moodle.com/",
            "moreinfourl": "https://docs.moodle.org/37/fr/error/debug/invalidresponse",
            "debuginfo": "identityproviders => Invalid response value detected: iconurl => Invalid response value detected: Invalid external api response: the value is \"http://my.moodle.com/pluginfile.php/1/auth_cas/logo//moodle_d.png\" of PHP type \"string\", the server was expecting \"url\" type\nError code: invalidresponse"




            • Votes:
              11 Vote for this issue
              8 Start watching this issue


              • Created: