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

allow blacklist auth plugins

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.9.7, 2.0
    • Fix Version/s: 2.0
    • Component/s: Authentication
    • Labels:
      None
    • Difficulty:
      Moderate
    • Affected Branches:
      MOODLE_19_STABLE, MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE

      Description

      Without this patch, it is not possible to write an authentication plugin that prevents certain users from logging in under certain conditions, if there is another authentication plugin that will authenticate them. This patch adds a pre-authentication hook during the login process, so an auth plugin can return AUTH_DENIED at that point and prevent any further possibility of login via another plugin.

      This patch also introduces a class named auth_status, and uses it to return the state of authentication (currently just status, message, errorcode) from the pre-authentication hook and then keep it all in one place. Since this patch is intended for the stable release, the changes are minimized and this isn't being used extensively. But auth_status could be expanded to include more information, and it could be used throughout the login process in order to simplify login/index.php by not relying variously on $frm, $user, and $errormsg at different points.

      I've also attached a very simple demo blacklist plugin that denies all authentication for a user named 'test1'.

        Attachments

        1. alt-login-blacklist_moquist.patch
          0.7 kB
        2. blacklist_sk.tar.gz
          0.6 kB
        3. blacklist-demo.tgz
          1 kB
        4. preauth-197.patch
          3 kB
        5. preauth-20.patch
          3 kB

          Activity

            People

            Assignee:
            skodak Petr Skoda
            Reporter:
            moquist Matt Oquist
            Tester:
            Nobody
            Participants:
            Component watchers:
            Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              24/Nov/10