SAML2 Single sign on

Authentication ::: auth_saml2
Maintained by Catalyst IT, Brendan Heywood, Rossco Hellmans
SAML done 100% in moodle, fast, simple, secure
Latest release:
3782 sites
3k downloads
93 fans
Current versions available: 5

What is this?

This plugin does authentication, user auto creation with field mapping.

Why is it better?

  • 100% configured in the Moodle GUI - no installation of a whole separate app, and no touching of config files or generating certificates.
  • Minimal configuration needed, in most cases just copy the IdP metadata in and then give the SP metadata to your IdP admin and that's it.
  • Fast! - 3 redirects instead of 7
  • Supports back channel Single Logout which most big organisations require (unlike OneLogin)

How does it work?

It completely embeds a SimpleSamlPHP instance as an internal dependancy which is dynamically configured the way it should be and inherits almost all of it's configuration from Moodle configuration. In the future we should be able to swap to a different internal SAML implementation and the plugin GUI shouldn't need to change at all.

Features

  • Dual login VS forced login for all as an option, with ?saml=off on the login page for manual accounts, and ?saml=on supported everywhere to deep link and force login via saml if dual auth is on.
  • SAML attributes to Moodle user field mapping
  • Automatic certificate creation
  • Optionally auto create users

Features not yet implemented:

  • Enrolment - this should be an enrol plugin and not in an auth plugin
  • Role mapping - not yet implemented

Installation

1) Install the plugin the same as any standard moodle plugin either via the Moodle plugin directory, or you can use git to clone it into your source:

git clone git@github.com:catalyst/moodle-auth_saml2.git auth/saml2

2) Then run the Moodle upgrade 3) If your IdP has a publicly available XML descriptor, copy this url into the SAML2 auth config settings page 4) If your IdP requires whitelisting each SP then in the settings page is links to download the XML, or you can provide that url to your IdP administrator.

For most simple setups this is enough to get authentication working, there are many more settings to define how to handle new accounts, dual authentication, and to easily debug the plugin if things are not working.

If you have issues please log them in github here:

https://github.com/catalyst/moodle-auth_saml2/issues

Or if you want paid support please contact Catalyst IT Australia:

https://www.catalyst-au.net/contact-us

Testing

This plugin has been tested against:

  • SimpleSamlPHP set up as an IdP
  • openidp.feide.no
  • testshib.org
  • An AAF instance of Shibboleth

Other SAML plugins

The diversity and variable quality and features of SAML Moodle plugins is a reflection of a great need for a solid SAML plugin, but the neglect to do it properly in core. SAML2 is by far the most robust and supported protocol across the internet and should be fully integrated into moodle core as both a Service Provider and as an Identity Provider, and without any external dependencies to manage.

Here is a quick run down of the alternatives:

Core:

  • /auth/shibboleth - This requires a separately installed and configured Shibbolleth install

One big issue with this, and the category below, is as there is a whole extra application between moodle and the IdP, so the login and logout processes have more latency due to extra redirects. Latency on potentially slow mobile networks is by far the biggest bottle neck for login speed and the biggest complaint by end users in our experience.

Plugins that require SimpleSamlPHP

These are all forks of each other, and unfortunately have diverged quite early or have no common git history making it difficult to cross port features or fixes between them.

Plugins which embed a SAML client lib:

These are generally much easier to manage and configure as they are standalone.

  • https://moodle.org/plugins/view/auth_onelogin_saml - This one uses it's own embedded saml library which is great and promising, however it doesn't support 'back channel logout' which is critical for security in any large organisation.

  • This plugin, with an embedded and dynamically configured SimpleSamlPHP instance under the hood

Warm thanks

Thanks to the various authors and contributors to the other plugins above.

Thanks to LaTrobe university in Melbourne for sponsoring the initial creation of this plugin:

http://www.latrobe.edu.au

LaTrobe

Thanks to Centre de gestion informatique de l’éducation in Luxembourg for sponsoring the user autocreation and field mapping work:

http://www.cgie.lu

CGIE

This plugin was developed by Catalyst IT Australia:

https://www.catalyst-au.net/

Catalyst IT


Screenshots

Screenshot #0

Contributors

Catalyst IT (Lead maintainer)
Brendan Heywood: Solutions Architect
Rossco Hellmans: Developer
Adam Riddell: Developer
Daniel Thee Roperto: Developer
Kristian Ringer: Developer
Please login to view contributors details and/or to contact them

Comments RSS

Show comments
  • Silvia Pinheiro
    mié, 7 de avi de 2022, 18:04
    Hello, I've tried to update this plugin twice now and it keeps coming back with the same error: SAML2 exception: The username must be in lower case

    I've tried to debug it but it's hard on localhost. The usernames we use are lowercase, however each time I'm logging with a new account, this error happens. Can I past here the error message or should I open a post on moodle forum please? Thank you
  • Jeff White
    mar, 25 de xnt de 2023, 01:25
    When will this plugin update to the latest release of simplesamlphp? Our security scans found several major vulnerabilities that need to be addressed.
  • Thomas Johansson
    mar, 12 de set de 2023, 04:01
    Hi,
    When will you release a version for moodle 4.2?
  • Alain Raap
    xue, 19 de och de 2023, 23:08
    I have a (NOAUTH) problem with the use with Redis, we use Redis with authentication, but where can I configure this in the plugin?
  • James Swash
    vie, 23 de feb de 2024, 19:46
    Is there a way to initiate the bulk creation of users from the IDP into Moodle, with a cron task perhaps?
  • mik dodge
    vie, 19 de abr de 2024, 07:35
    it's not supporting Moodle 4.3.2 tristayu
  • Ezzeddin Hamed
    mié, 24 de abr de 2024, 17:13
    Would it be updated to include Moodle versions 4.3 & 4.4?
    Thanks,
  • Felix Witte
    xue, 5 de set de 2024, 21:54
    Would b really great to get it for version 4.4
  • Clark Ragay
    mar, 24 de set de 2024, 11:54
    Hello folks, firstly thanks for contributing to the community for this great plugin.

    Is there any indication of when the next update will be released, to support, Moodle version 4.3 onwards?

    Thanks!
  • Friedhelm
    mar, 1 de och de 2024, 14:33
    Hello!

    When debugging pdfannotator we get the following message in Moodle 4.4.3
    Callback before_standard_html_head in auth_saml2 component should be migrated to new hook callback for core\hook\output\before_standard_head_html_generation

    We always get the latest version from the plugin repository.

    Best regards
    Friedhelm
  • Ken Stokes
    mar, 7 de xin de 2025, 02:12
    When will SAML2 be available for Moodle 4.4 or better yet, 4.5?
  • Thomas Johansson
    mié, 8 de xin de 2025, 20:20
    When will SAML2 be available for Moodle 4.5?
  • Pablo Schmid
    llu, 10 de feb de 2025, 16:53
    I am very grateful for this plugin. When will SAML2 be ready for Moodle 4.5?
  • Alberto Villani
    xue, 13 de feb de 2025, 22:54
    Hello, is there a way to make the plugin work with encrypted assertions from the IDP?
    We are getting "SAML2 exception: Failed to decrypt XML element." error.
    If encryption is disabled in the IDP everything works fine.
    Thank you!
  • Eiz E A.
    mié, 16 de abr de 2025, 18:52
    which version should I use for Moodle 4.4? It's not listed as supported by any version.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Please login to post comments