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

web services calls to core_user_create_users fail when using cas auth

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.3.8, 3.3.3, 3.4
    • Fix Version/s: None
    • Component/s: Authentication
    • Labels:
    • Affected Branches:
      MOODLE_23_STABLE, MOODLE_33_STABLE, MOODLE_34_STABLE

      Description

      As others have noted, e.g.:

      https://moodle.org/mod/forum/discuss.php?d=224809

      web services calls to core_user_create_users fail when using 'cas' as the value of the 'auth' parameter, with the error:

      <EXCEPTION class="moodle_exception"> <ERRORCODE>auth_ldap_noconnect_all</ERRORCODE> <MESSAGE>LDAP-module cannot connect to any servers: No LDAP Host URL, Version or User Type specified in your LDAP settings</MESSAGE></EXCEPTION>

      I performed a backtrace, and found that this is due to the fact that the auth_plugin_cas class extends the auth_plugin_ldap class, and does not specify its own implementation of the user_update_password function. This function is called as part of adding a user via core_user_create_users. It makes sense that auth_plugin_cas does not implement user_update_password, as the cas client cannot set the cas password on the server side. As a workaround, I added an empty user_update_password function to the auth_plugin_cas class in auth/cas/auth.php:

      function user_update_password($user, $newpassword)

      { return true; }

      This might be a good general solution, but my colleague pointed out that something more complex might be necessary when cas+ldap is being used.

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            dfj David Jorm
            Participants:
            Component watchers:
            Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Sujith Haridasan
            Votes:
            11 Vote for this issue
            Watchers:
            7 Start watching this issue

              Dates

              Created:
              Updated: