Moodle Shibboleth SSO for university federations

Moodle's core Shibboleth plugin lets campus and national federation users sign in through a Shibboleth Service Provider. This page covers how it works, what to configure and when the SAML2 plugin is the simpler route.

On this page

Moodle Shibboleth SSO for university federations: what it does and when you need it

If you run Moodle for a university and your users already hold credentials from a campus or national federation, the goal is usually simple: students and staff sign in with their home institution account and never set a Moodle password. Moodle core ships a Shibboleth authentication plugin that creates and authenticates users based on Shibboleth sign-in, so you may not need a third-party plugin for this job. The plugin does not handle the federation handshake on its own, though. A Shibboleth Service Provider (SP) runs alongside your web server in front of Moodle, talks to your federation's identity provider, and passes the authenticated session and user attributes to Moodle through the web server. Moodle trusts those values only because the SP has already vouched for them.

That split of responsibilities shapes the first decisions. Your team must decide which SP software to run, where it sits in your web server configuration, and how it is registered in the federation metadata that your identity provider and federation operator rely on. Your identity and federation team must confirm which attributes the federation releases to Moodle, under what names, and whether they are released for every user or only for certain affiliations. Before any build work, confirm these with the federation operator and your identity provider, because Moodle can only map attributes that actually arrive. Also confirm that the SP and your web server are supported together in your environment, since the plugin documentation and your own hosting stack will set the constraints.

Shibboleth is not the right answer for every university. If your federation does not release the attributes you need, if your users come from several identity sources that are not in one federation, or if your team does not want to operate an SP and web server module, a SAML 2.0 route may be simpler. The SAML2 Single sign on plugin (auth_saml2), maintained by Catalyst IT, creates users with field mapping configured in Moodle and lists support for Moodle 2.7 through 5.1, so confirm the current compatibility for your Moodle version before you choose it. Where the decision sits between the two is covered below.

How a federated sign-in reaches Moodle

The flow starts in the user's browser, which requests a Moodle page and is redirected to the Shibboleth Service Provider sitting in front of Moodle. The Service Provider sends the user to the identity provider at their home institution, which authenticates them and returns assertions with attributes. The Service Provider passes those attributes to Moodle's Shibboleth authentication plugin, which matches or creates the account. Check that the metadata trust relationship is in place and that the attributes Moodle expects are actually released by the home institution.

Federated sign-in path from browser to Moodle user record, with the metadata trust link.

Shibboleth plugin or SAML2 plugin: which fits your federation

This table compares the core Shibboleth authentication plugin with the SAML2 Single sign on plugin across maintenance, user creation, field mapping, federation fit and upgrade effort. Use it to shortlist an option, then confirm the open points against your federation's metadata rules and the plugin's current support notes before you commit.

CriterionCore Shibboleth plugin (auth_shibboleth)SAML2 plugin (auth_saml2)
Where it comes fromShips in Moodle core under the public/auth directory, so it is part of the core codebaseCommunity plugin maintained by Catalyst IT and listed in the Moodle plugins directory
How users are createdCreates and authenticates users from Shibboleth attributes passed by the Service ProviderCreates users with field mapping configured inside Moodle; confirm the account creation options in the plugin settings
Field mappingMaps identity attributes from the Shibboleth Service Provider to Moodle user fields; confirm the exact attribute names your federation releasesMaps SAML assertion attributes to Moodle user fields through its own configuration screen; confirm supported fields for your version
Federation fitBuilt around the Shibboleth Service Provider, which many campus and national federations already run; confirm your federation's metadata and attribute release policyWorks with any SAML 2.0 identity provider that publishes metadata to your site; confirm the metadata and certificate workflow your federation requires
Moodle version coverageFollows the Moodle release cycle because it is core code; confirm behaviour on your target release in the release notesListed as supporting Moodle 2.7 through 5.1; confirm support for the release you plan to run before upgrading
Upgrade effort on new releasesTested through core releases, so upgrades carry no separate plugin version to match; still test SP and attribute settings after each upgradeA third-party plugin version must be matched to each Moodle release; plan a compatibility check and test sign-in on staging for every upgrade
When it is the simpler choiceSites that already run a Shibboleth Service Provider and want to stay on core codeSites that need SAML 2.0 without a Shibboleth Service Provider, or that prefer field mapping managed in Moodle

How to configure Shibboleth SSO in Moodle, step by step

This sequence takes a Moodle site from federation metadata to a tested Shibboleth sign-in, with attribute mapping, first-login account creation and logout verified before users are routed to it. Each step ends with a check so the team knows it can move forward.

  1. Confirm federation and metadata requirements

    Before touching the server, confirm with your federation operator which entity ID, metadata source and attribute set your Service Provider must use, and whether your institution must register the SP or only consume the federation metadata. Ask the federation which attributes it releases for your organization, such as a persistent identifier, username, email and affiliation, and whether each one is mandatory. Record the answers in a short sign-off document. Done when the federation has confirmed in writing the entity ID, metadata URL and released attribute names, and your identity team has agreed which attribute will be the Moodle username.

  2. Install and configure the Shibboleth Service Provider

    On the web server host, install the Shibboleth Service Provider daemon and its web server module, then configure the SP with your entity ID, the federation metadata, your signing and encryption certificates, and the attribute mapping file that translates released attribute names into the names Moodle will read. Protect the Moodle Shibboleth handler path so that the web server hands sign-in requests to the SP. Check the SP logs for a clean start and confirm that the SP metadata endpoint returns the expected XML. Done when the metadata endpoint is reachable from the federation and the SP starts without configuration errors.

  3. Set the web server document root for Moodle 5.1 or later

    If the site runs Moodle 5.1 or later, point the web server document root at the new public directory inside the Moodle code folder rather than the main Moodle folder. Moodle's 5.1 release notes state that otherwise the site may show directory listings or errors. Make this change before enabling the auth plugin so that the SAML and Shibboleth handler paths resolve correctly. Done when the Moodle front page loads without a directory listing and the site administration pages open over HTTPS.

  4. Enable and configure the core Shibboleth plugin

    In Moodle, go to Site administration, then Plugins, then Authentication, and enable the Shibboleth authentication plugin. Open its settings and set the login link text, the session variable and the attribute names that map to Moodle user fields, such as the username, first name, last name and email. Select whether new users are created automatically on first sign-in and which authentication method is used for existing manual accounts. Keep a manual administrator account active during this work so you can recover if sign-in fails. Done when the plugin appears as enabled and its settings page saves without errors.

  5. Map federation attributes to Moodle user fields

    Map each released attribute to a Moodle user profile field and decide which field identifies the account. Use the persistent identifier or a stable username attribute rather than a display name, because changing the matching field later can create duplicate accounts. Confirm that the attribute values arrive in the expected format, for example whether email addresses are lowercase and whether scoped values include the domain suffix. Document the mapping in your configuration record. Done when a test sign-in shows each attribute populated in the SP session and the mapped fields match the values from the identity provider.

  6. Test user creation with a test account

    Create a dedicated test account at your identity provider, ideally one that is not a real staff or student identity, and sign in to Moodle through the Shibboleth login link. Check that Moodle creates one new user record with the mapped fields, that the account is not an administrator and that a second sign-in reuses the same record rather than creating a copy. Review the Moodle logs and the SP logs for the sign-in. Done when the account is created once, reused on the second sign-in and has the correct name and email on its profile.

  7. Verify logout and session end

    Sign out of Moodle and confirm that the Moodle session ends and that the SP session is also closed, so that a later visit to the login page requires a fresh sign-in at the identity provider. Test whether the single logout behavior your federation supports works from the identity provider side, and document what happens if the user closes the browser without signing out. Confirm the logout behavior with your federation operator and your identity team, because support for single logout varies between federations and identity providers. Done when a logout from Moodle returns the user to a signed-out state and a new visit triggers a fresh federation sign-in.

  8. Decide whether the SAML2 plugin is simpler

    Before you roll out, review whether the core Shibboleth plugin fits your federation or whether the SAML2 Single sign on plugin (auth_saml2) is the simpler route. The SAML2 plugin is maintained by Catalyst IT, creates users with field mapping configured in Moodle, and lists support for Moodle 2.7 through 5.1 in the plugins directory. Compare the effort to keep the SP and the plugin patched, the attribute and logout behavior each one needs, and whether your team already runs SAML tooling. Record the decision with the reasons. Done when the team has a signed-off choice between the two approaches and a plan for patching the chosen component.

Attribute mapping and user creation decisions

The decision that shapes everything else in a Shibboleth deployment is which federation attribute becomes the Moodle username, because that value decides whether a returning person is matched to their existing account or receives a new one. The core auth_shibboleth plugin creates and authenticates users from the attributes the Shibboleth Service Provider passes to Moodle, and its settings let you map incoming attributes onto Moodle account fields such as the username, first name, last name and email address. Before go-live, confirm with your federation operator which attributes your identity provider releases to your Service Provider and whether the candidate identifier is released at all. Many federations release a persistent, non-reassignable identifier and an email address, but release of a particular attribute is a policy decision made per service, so do not assume the name you see in a test account is the one every user will receive.

Choose the stable identifier with care. An email address is convenient but can change when a person marries, changes department or leaves and returns, and a reused address can attach an old account to a new person. A persistent identifier from the federation is usually more stable, but it may not be human-readable, which affects support and reporting. Decide in advance how existing Moodle accounts created by manual upload, LDAP or self-registration will be matched to the Shibboleth identity, since a mismatch on first sign-in produces a second account for the same person. Test this with a sample of real staff and student records from your SIS in a staging site, and record which field each account is matched on before any bulk change.

Plan the first sign-in behavior and the fields Moodle must hold before creating accounts. Confirm whether the plugin should create accounts automatically on first login or whether only accounts pre-loaded by another process may sign in, and whether you need the Moodle profile to be complete before a user reaches courses. Map the attributes that drive course access, such as affiliation or department, to fields or cohorts you can use later, and agree the handling for missing attributes, since an empty value can silently break a rule. Review the attribute list against your federation's release policy and your own data minimization rules, and document the mapping so the security and compliance teams can check exactly which personal data Moodle stores.

Security and operational risks of federated sign-in in Moodle

Federated sign-in moves trust from Moodle's local password store to your identity provider and Service Provider. The cards below cover the places where that trust can fail quietly: attributes, sessions, certificates, administrator access and sign-in monitoring.

Verify the source of identity attributes

Moodle creates and updates accounts from the attributes the Shibboleth Service Provider passes to it, so any attribute that reaches Moodle unchecked can grant a role or a course membership. Confirm which identity provider scopes and entity IDs your federation metadata trusts, and check that the attribute used as the username is unique and stable. In illustrative setups, a locally asserted attribute can be mistaken for a federated one, so test a sign-in with a non-affiliated account before go-live.

Shibboleth plugin strings

Align session and logout behavior

Moodle keeps its own session after the Service Provider session ends, so a user who leaves the federation can stay signed in to Moodle until that session expires. Document the expected behavior, decide whether single logout is supported in your setup, and test a logout from the identity provider, the SP and Moodle in sequence. Confirm session lifetimes on both sides, since they rarely match by default.

Plan certificate and metadata rotation

Federation metadata and signing certificates expire, and a rotation that is not coordinated breaks sign-in for every user at once. Record the expiry dates of the SP and identity provider certificates, subscribe to metadata change notices from your federation operator, and keep a dated runbook for replacing the SP certificate and reloading metadata. Test the rotation in a staging Moodle before the production date.

Control administrator accounts outside SSO

Moodle keeps local administrator accounts that can sign in with a password even when federated sign-in is working, which gives an attacker a route around the identity provider. Decide which local accounts remain, store their credentials under your privileged access process, enforce multi-factor authentication on them, and review the list each quarter. Confirm the auth method of every site administrator account from the administration pages.

Monitor sign-in failures and anomalies

Failed federated sign-ins often appear only as generic login errors in Moodle, so a broken attribute release can go unnoticed until users report it. Enable and review Moodle's logs for authentication events, forward the Service Provider and web server access logs to your central log platform, and set alerts on sudden spikes in failures or on new accounts created from federation. Assign a named owner for the alerts.

Questions buyers ask before hiring help with Moodle Shibboleth SSO

What drives the cost of a Moodle Shibboleth SSO project?

The main cost driver is how much coordination the federation and identity provider work requires, not the Moodle configuration itself. Effort rises with the number of Shibboleth Service Provider deployments, the number of attributes that must be released and mapped, whether you run a test and a production site, and how many account types (staff, students, guests, alumni) must sign in. A fixed-scope quote should list each of these items separately, state who performs the federation registration steps, and say what is included in testing and handover. Ask for the cost of any follow-up work for logout behavior and for upgrade verification, since those recur. DeployOpen does not publish prices; a quote follows from the written scope.

How long does Moodle Shibboleth SSO setup take?

Duration depends mostly on external steps: the time your federation operator or identity team takes to review metadata, approve the Service Provider registration, and release attributes. Technical work on Moodle and the Shibboleth Service Provider is usually shorter than these approval cycles. Testing with real test accounts from several identity provider populations often takes longer than expected because edge cases such as missing email attributes or unexpected affiliation values appear only then. Ask any provider to split its timeline into federation onboarding, build, testing with your identity provider, and production cutover, and to state which steps depend on your team.

What does the university need to provide for the project?

The university needs to supply several things before build work can finish:

  • Contacts in the identity management team and the federation operator who can approve metadata and registration.
  • Metadata for the identity provider and access to the federation's registration process for your Service Provider entity.
  • Test accounts covering the user populations that will sign in, including staff, students and any guests.
  • A written attribute agreement stating which attributes the identity provider will release, their names, formats and whether they are scoped.

Missing any of these typically moves the schedule more than any technical problem.

Can our internal team set up Moodle Shibboleth SSO without a partner?

Yes, if your team has Linux web server administration experience, can operate a Shibboleth Service Provider, and has a working relationship with the identity team. The Moodle side is a configuration task within the core authentication plugin, but correct attribute mapping, user creation rules and logout handling need someone who reads the Service Provider logs and understands the federation metadata. Teams without this skill often find that the first login works while later edge cases fail. Consider a partner for design review, a test plan, or handover documentation even when the team does the build itself.

When should we choose the SAML2 plugin instead of Moodle's Shibboleth authentication?

Choose the SAML2 Single sign on plugin (auth_saml2) when the identity provider speaks SAML 2.0 directly and you do not need the Shibboleth Service Provider in front of Moodle. The SAML2 plugin is maintained by Catalyst IT, creates users using field mapping configured in Moodle, and lists support for Moodle 2.7 through 5.1, so confirm its compatibility with your target release before you commit. Core Shibboleth authentication fits campus and national federations that already run a Shibboleth Service Provider and want to reuse its attribute handling. Compare the attribute release model, the logout behavior each option gives you, and the number of components your team must patch.

How do Moodle upgrades affect a Shibboleth SSO setup?

Moodle major releases arrive in April and October, and point releases every two months, so an SSO configuration will be tested against several versions over its life. Check the Moodle release notes for each target version, because server requirements change: Moodle 5.1 requires PHP 8.2 or later and a document root that points to the new /public directory, and Moodle 5.3 requires PHP 8.3 or later. The Shibboleth Service Provider and web server also need compatible versions. Plan a test site that mirrors production, re-verify attribute mapping and logout after each upgrade, and confirm which upgrades a support retainer covers.

What goes wrong most often with Shibboleth login and logout in Moodle?

The most common failures are attribute mismatches, where the identity provider releases a value in a different format from what Moodle expects, and account matching errors that create duplicate users when a username changes. Logout is another frequent gap: signing out of Moodle does not necessarily end the federated session, so users may remain signed in at the identity provider. Verify each of these with test accounts before go-live, and document how Moodle handles users who lose access in the directory. Ask any provider how it tests logout and what it records as evidence.

How Moodle upgrades affect a federated sign-in setup

Each Moodle release sets its own minimum PHP and database versions, so a Shibboleth setup that works today can break during an upgrade even when the sign-in configuration itself never changes. Plan every upgrade as a change to the federated sign-in path, not only to Moodle. Moodle 5.1 requires 64-bit PHP 8.2 or later (8.3 and 8.4 are supported) and PostgreSQL 15, MySQL 8.4, MariaDB 10.11 or Microsoft SQL Server 2017 or later, and sites must already be on Moodle 4.2.3 or later to upgrade. Moodle 5.3 raises the bar to 64-bit PHP 8.3 or later (8.4 supported), PostgreSQL 17, MySQL 8.4, MariaDB 11.4 or SQL Server 2019 or later, and requires an existing site on Moodle 4.4 or later. Your Shibboleth Service Provider, web server and PHP runtime must be checked against these numbers at the same time.

The 5.1 release also changes the web server layout. From Moodle 5.1, the document root must point to the new public directory instead of the main Moodle folder. If the web server still points at the old root, the site may show directory listings or errors, and the Shibboleth handler path that sits in front of Moodle can be misrouted. Update the virtual host and the paths the Service Provider protects in the same change window, and confirm that the /Shibboleth.sso handler still responds before you test a login. Moodle 5.3 also removes the Classic theme from core, which matters only if your sign-in or landing pages depend on it.

Before you go live on any target release, confirm the status of the Shibboleth authentication plugin on that version in the Moodle GitHub repository, and check the plugin's own release notes for changes to attribute handling or logout. Then retest the full path after every upgrade: a federated login with a new account, a returning user, a user whose attributes changed, and logout from both Moodle and the Service Provider. Keep a written test script and record which release, PHP version and Service Provider version each test ran against, so that a failure can be traced to the upgrade rather than to the federation.

How to verify federated sign-in before go-live

This sequence proves that federated sign-in works end to end for each partner institution, that the accounts Moodle creates carry the right fields, that removed identities are locked out, and that logout behaves as expected. The output is a dated test record that goes into the change record before the cutover is approved.

  1. Confirm the test matrix and accounts

    Before any sign-in test, the project lead agrees a matrix with the identity team at each federated home institution. It lists one test account per institution, the attributes each account should release, and the expected Moodle role or cohort for each. Ask each institution to confirm in writing which attributes its identity provider releases to your service provider, since release policies differ between federations. The step is done when every row in the matrix has a named owner and an expected result.

  2. Sign in with a test account from each institution

    The tester opens a private browser session, starts at the Moodle login page, selects the Shibboleth option and signs in with the test account from the first home institution. Repeat for every institution in the matrix, using a fresh browser session each time so that no earlier session is reused. Record the time, the institution, and whether the user lands on the expected page. The step is done when every institution has a successful sign-in recorded against its matrix row.

  3. Check the user record Moodle creates

    An administrator opens the user profile for each test account in Moodle and compares the stored fields with the attribute mapping agreed in the design. Check the username, first name, last name, email address, institution and any custom profile fields, and confirm that the authentication method shows Shibboleth. Confirm that the account has the cohort or role the matrix expects. The step is done when each field matches the mapping, and any mismatch has a logged defect with the attribute value that caused it.

  4. Confirm a suspended identity cannot sign in

    The identity team suspends or disables one test account at its home institution, then the tester attempts to sign in to Moodle with that account. Access should fail at the identity provider or be refused by Moodle, and the tester should confirm that no new session appears. Also check how Moodle treats the existing user record, including whether it is suspended or left active, because this depends on your configuration and the plugin version. The step is done when the denied sign-in is recorded with the time and the outcome, and the account state in Moodle matches the design.

  5. Test logout from Moodle and the federation session

    The tester signs in with a test account, opens two browser tabs, and logs out from Moodle. They then confirm whether the federation session at the identity provider has also ended, by opening a protected Moodle page in the second tab and by checking the identity provider's own session state if the provider exposes one. Repeat the test starting from the identity provider's logout page if your federation supports it. Document the exact behavior observed, because single logout depends on how the service provider and identity provider are configured. The step is done when the logout behavior for each path is recorded and any gap has a decision recorded: accept it, or fix it before go-live.

  6. Record results and attach them to the change record

    The project lead compiles the matrix, the screenshots or logs for each test, the defect list and the tester's name and date for each row into one evidence document. Each failed row needs a documented fix and a retest result before the record is closed. Store the document in the change system with a link to the configuration version tested, so that auditors or reviewers can match the evidence to the production settings. The step is done when the change approver has signed off on the evidence and every open defect has an owner.

How DeployOpen scopes and delivers Moodle Shibboleth SSO

DeployOpen plans and implements Moodle Shibboleth SSO inside your own infrastructure, working from a written scope that sets out the federation, the Shibboleth Service Provider, the attribute mapping and the logout behavior before any build starts. The work is delivered as a fixed-scope engagement with agreed deliverables, and the resulting setup is documented so your identity and security teams can review it.

How we scope

  • Confirm which federation or identity provider you connect to and the metadata agreements that apply to it.
  • Agree in writing which attributes the Shibboleth Service Provider releases and how Moodle maps them to user fields.
  • Record the decision between the core Shibboleth plugin and the SAML2 plugin, with the reasons, before build begins.

How we build

  • Configure the Shibboleth Service Provider and the Moodle authentication plugin on the servers and network you control.
  • Test user creation, account matching and attribute updates with sample accounts from your federation or test IdP.
  • Verify single logout behavior and the session timeout path, then record the results in the test report.

How we hand over

  • Deliver configuration documentation covering attribute mapping, certificates, metadata locations and recovery steps.
  • Walk your administrators through how new users are created, how accounts are suspended and how to read the logs.
  • Provide a retest checklist so your team can repeat the verification after upgrades or certificate renewals.

How we support

  • Ongoing support, upgrades and continuous testing are available as retainers after handover.
  • Plan Moodle upgrades and Service Provider updates against the release calendar and retest SSO after each change.
  • Confirm with your federation operator any changes to metadata, certificates or attribute release before rollout.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.