Any authentication module can implement Single Sign On (SSO) by adding a loginpage_hook
member function. The Moodle core system will call this function, for each registered authentication plugin, prior to displaying the login page. By hooking in front of the login page, we can perform identity verification using information from a third-party application. Examples from core Moodle include the LDAP module's support for SSO from the user's Windows login and the CAS module. Both of these plugins implement the loginpage_hook()
function to accomplish this.
Let's take a look at a simple example of SSO.
In this section, we will expand the simple
authentication module in order to support a basic SSO. The method used will be a specially-formatted URL. The format of our URL for SSO will be as follows:
http://my_site/login/index.php?username=myaccount&secret=mysecret
The URL includes two parameters: username
and secret
. The username
will...