Authentication plugins are placed inside Moodle's auth
folder. They have two major requirements: an auth.php
file and a language file. In this section, we will cover the minimal requirements of creating as basic a module as we can. This module will be called simple
.
Authentication plugins are of medium complexity. They don't require many files to be defined. However, there are several functions that can be defined in the plugin classes. Let's have a look at the primary file.
The auth.php
file needs to include /lib/authlib.php
. This library defines the auth_plugin_base
class that is the basis for any new authentication module. Within the auth.php
file, we need to extend class auth_plugin_base
as auth_plugin_<name>
, where name
is the name of the module's folder. For the simple
authentication module this looks similar to the following:
class auth_plugin_simple extends auth_plugin_base {
As a minimum...