Moodle multi-factor authentication: when a campus rollout needs it
If your institution or regulated training provider must add a second factor to learner, staff and admin sign-in on a self-hosted Moodle, you can start with the feature already in the product. Multi-factor authentication is built into Moodle core from version 4.3 onward, so you do not need a third-party plugin to turn it on. The harder questions are which factors to allow, who is covered by the requirement, how it sits alongside any single sign-on you run, and how your support desk absorbs the change. Core MFA is also not a complete control on its own: confirm the factor types, enrolment and enforcement options, and any admin-only or per-role scope against the exact release you run, since the settings and their defaults can change between versions.
Plan for the places where the core feature stops short of your requirement. If sign-in goes through a central identity provider, the second factor may belong at that provider rather than in Moodle, and a site that accepts both paths can leave a gap that auditors will find. Web services, mobile app tokens and automated integrations also authenticate differently from a browser login, so you need an explicit position on them before rollout. Service accounts that must run unattended will need a documented exemption, a restricted role and a named owner, and the scope of any exemption should be written down and reviewed rather than left to whoever configures the site. Confirm each of these against your identity architecture, not only against the Moodle settings page.
The rest of this page works through those decisions in order: choosing factors and enforcement scope, combining MFA with SSO, setting exemptions for service accounts, and estimating the support load of a campus-wide rollout. Each decision affects the others, so settle the identity architecture and the list of accounts that cannot use an interactive second factor before you configure anything in production. Your compliance team should also confirm which of their own controls the MFA evidence is meant to support, because that determines what logs and reports you need to keep.
Which MFA options to enable and when each fits
This table compares the configuration choices a team makes when turning on Moodle multi-factor authentication: which factors to allow, who is enforced, whether the policy reaches local accounts, and how grace periods work. Read each row against the release your site runs, and treat the 'confirm before committing' column as the checklist to close before rollout.
| Choice | When it fits | Confirm before committing |
|---|---|---|
| Factor types offered | Campuses that want a choice of app-based codes, security keys or other methods the release provides | Which factor plugins your installed release ships and which are optional installs, in the release notes and the MFA admin settings |
| Enforcement by role | Staff and administrators who hold elevated rights, where a stronger requirement is easier to justify than for learners | Which roles are covered, and whether site administrators can be locked out if their factor is lost |
| Enforcement by population | Campus-wide rollouts that move in stages, such as one faculty or cohort before the whole institution | How cohorts are defined in your user data, and whether a population change takes effect at next sign-in |
| MFA on local Moodle accounts | Sites that keep manual or self-registered accounts alongside a directory, where local accounts are still a sign-in route | Whether local password sign-in is still reachable after SSO is live, and whether the policy applies to every authentication plugin |
| MFA only through an identity provider | Sites where the identity provider already enforces MFA and Moodle should not prompt twice | That the identity provider enforces MFA for every sign-in path, including mobile app and web service access, and that local login is disabled or restricted |
| Grace period for enrolment | New learners or staff who need time to register a factor before access is blocked | How long the grace period lasts in your settings, and what happens to users who never register before the deadline |
| Service and API accounts | Accounts used by integrations, web services or scheduled tasks that cannot answer a prompt | Whether the exemption is limited to named accounts, whether it bypasses MFA only for token-based access, and who reviews it |
How a sign-in moves through Moodle, the identity provider and the second factor
The diagram starts at the learner's browser on the Moodle login page, which splits into two paths. A local account is checked against the Moodle database, while an SSO sign-in goes through the auth_saml2 plugin to the identity provider outside the campus network, which returns a signed assertion. Both paths meet at the second factor check before a Moodle session opens. Service accounts and web service tokens call the web service endpoint directly and never reach the login page, so the second factor does not apply to them. Confirm that each exemption is deliberate and that the identity provider sits where you expect.
Local, SSO and service account sign-in paths around the second factor check.
Combining MFA with SSO without double prompts or gaps
The first decision is which system owns the MFA policy, and you must settle it before you configure either side. There are two common designs. In the first, multi-factor authentication is enforced at the identity provider, and Moodle trusts the assertion it receives, so learners see one set of prompts no matter which application they open. In the second, Moodle enforces MFA itself for accounts that do not use single sign-on, such as local administrator accounts or a fallback group. Many sites need both, which is where gaps and double prompts appear. Confirm with your identity team whether the provider can enforce a step-up requirement per application, and whether Moodle's own MFA settings will be turned on at all in your version.
When Moodle uses SAML 2.0 through the SAML2 Single sign on plugin (auth_saml2), the plugin creates or updates the Moodle account from the attributes the provider sends, based on the field mapping you configure. Check that the attributes used for matching are stable and unique, and that the plugin cannot silently link a new login to an existing local account with the same username. The larger risk is the manual login route: if the manual authentication plugin is still enabled, or if the login page still shows a username and password form, any account with a local password can sign in without passing through the identity provider. Review which accounts can use manual authentication, and restrict or disable that route for them.
Test session lifetime and sign-out across both systems as part of acceptance, not after go-live. Sign in through the provider, wait for the Moodle session to expire, and confirm whether the user is re-challenged or silently re-authenticated, and whether that happens once or twice. Then sign out from Moodle and confirm the provider session ends too, and sign out at the provider and confirm Moodle no longer accepts the existing session cookie. Record the results for each device type and browser your learners use. Ask your identity provider and plugin maintainer to document the session and logout behavior for your exact versions, since these settings interact with the Moodle version you run.
Setup sequence for MFA in a self-hosted Moodle
This sequence takes a self-hosted Moodle from a version check through a tested pilot to a campus-wide rollout, with a recorded check after each step so that enforcement never breaks sign-in routes the organization still depends on. It is designed to be run by the team that owns the Moodle site, with the identity and integration owners involved from the start.
Confirm the Moodle release and version floor
Confirm the exact Moodle release the site runs and that it is 4.3 or later, since built-in multi-factor authentication is part of that line. Check the release notes for the version you plan to move to as well, because the MFA settings and the surrounding authentication plugins can change between releases. Also confirm the PHP, database and web server versions for the target release, and whether the web server document root must point to the public directory. The output is a written version record with a dated test site confirmed on the same release as production, so every later step is tested against what you will actually run.
Inventory every login route into Moodle
List each way a user or system authenticates: manual accounts, SSO through a SAML 2.0 or OAuth 2 provider, LDAP, external database, LTI launches from other tools, mobile app sign-in, and web service tokens used by integrations such as HR feeds or reporting jobs. For each route, record the owner, the users it serves, and whether it passes through the Moodle login form at all. Routes that never show the login form, including token-based web services and automated accounts, will not be covered by an interactive factor and need a separate decision in the next step. The output is an inventory that the security, identity and integration owners have each reviewed and signed off.
Decide the enforcement model
Choose which population must use a second factor, which factors they may use, and where enforcement happens. Decide whether MFA is enforced inside Moodle for local accounts only, whether the identity provider carries the second factor for SSO users, or whether both apply, and document how a user who signs in through SSO avoids a second prompt they cannot satisfy. Settle the list of factors you will allow and the policy for exemptions, including named service accounts that should never use an interactive login. The output is a written enforcement decision mapped against the route inventory, with each exemption justified and given an owner and a review point.
Configure a pilot group and test sign-in
Apply the chosen settings to a small pilot group of staff who understand the change and can report problems quickly, and keep those users off enforcement for any route you have not tested. Have pilot users sign in from a managed browser, the mobile app and any LTI or SSO entry point they normally use. Record each attempt with the route, device and result, and fix anything that blocks sign-in before expanding. The output is a pilot log that shows every route in the inventory has been exercised with at least one successful sign-in.
Test recovery paths before wider rollout
Rehearse the situations that will generate the most help requests: a lost or replaced phone, a new device registered during a support call, a user who cannot receive codes, and a locked account. Confirm who can reset a factor, how that action is authorized and logged, and how the user regains access without an administrator bypassing controls informally. Check that recovery does not require a route you have just locked down. The output is a written recovery runbook that the help desk has rehearsed on pilot accounts, with each path confirmed to restore access and leave an audit record.
Checkpoint: confirm mobile and web service access after enforcement
Before expanding, verify that the mobile app can still sign in and sync, that web service tokens used by integrations still authenticate, and that scheduled jobs and HR or reporting feeds still run without interactive prompts. Confirm that exempted service accounts remain exempt and that no integration has begun failing silently. Repeat this check after any change to enforcement, because a setting that is correct for browsers can break token-based and app-based access. The output is a dated checkpoint record showing each non-browser route passed, with any failures assigned to an owner and retested before the next step.
Expand enforcement by population
Widen enforcement in groups, such as one department, faculty or cohort at a time, rather than switching it on for the whole institution at once. Before each group, announce the change, publish the enrolment and setup guidance, and confirm the help desk has capacity and the runbook is current. Watch sign-in failures, lockouts and help requests after each group, and pause if the rate of problems rises. The output is a rollout record for each group showing its start date, the failure and support figures observed, and the decision to continue.
Record a check after each step and keep it current
Keep a single rollout record that holds the version confirmation, route inventory, enforcement decision, pilot log, recovery tests, checkpoint results and population changes. Review the exemption list and the factor list on a fixed schedule, and repeat the non-browser checkpoint after every Moodle upgrade and every change to the identity provider. Ask the auditor or compliance team which evidence they will want from this record before they request it. The output is a living record that lets a reviewer trace any enforcement setting back to the decision, the test and the owner who approved it.
The support load of a campus-wide rollout
The support load of a campus rollout is predictable in its sources even if its volume is not, so plan for the categories before the first enrolment email goes out. Expect tickets from lost or replaced phones, users who never enrolled a second factor and now cannot sign in, sign-in failures caused by a phone clock that has drifted from network time, and staff who sign in on shared lab or reception machines and then fail to complete a factor prompt on someone else's device. Students without a personal phone form a separate group, because the factors you enable must include an option they can use without owning a smartphone, or the rollout creates a access barrier that lands on the help desk. Ask your identity team to confirm which factors your Moodle build offers and which of them depend on a device the user owns, and write that list down before the help desk sees its first question.
Brief the help desk on the decisions, not just the steps. Front-line staff need to know which accounts are exempt (service and integration accounts should be handled by the platform team, never by a password reset at the desk), what identity proof is required before a factor is reset, and when to escalate a suspected account takeover instead of resetting the factor. Provide self-service recovery wherever the design allows it, such as a documented route for users to re-enrol a factor after confirming their identity through the single sign-on provider, and publish short guides with screenshots for each recovery path. Measure what the pilot generates in each category, then size staffing from those counts. Do not size the desk from assumed ticket rates.
Sequence the rollout by cohort so that enrolment pressure does not coincide with assessment deadlines. Start with staff and administrators, who can absorb a problem and report it, then move to cohorts whose courses have low-stakes activity in the first weeks. Avoid switching on a factor requirement for a course cohort in the days before a published quiz, exam window or assignment due date, and check the academic calendar with the teaching office rather than assuming the term dates. Confirm with your Moodle administrator how the enforcement setting applies to users who are mid-session, and plan a grace period only if your policy allows one. Each cohort step should have a go or no-go check based on pilot ticket volume and open incidents.
Security and operational controls to review before go-live
Moodle multi-factor authentication touches account recovery, privileged access, logging and day-two operations at the same time. The cards below set out what to verify before the first campus-wide prompt, and who in your organization should own each check so that no control is assumed to belong to someone else.
Recovery and lockout procedures
Write down what a user does when they lose their phone or hardware key, who can reset a factor, and how that person confirms identity before doing it. Test the path end to end with a dummy account, including the lockout threshold after repeated failed prompts. Help desk staff should be able to follow the written procedure without needing the engineer who configured the site. Owner: the identity or service desk lead, with the Moodle administrator confirming the settings.
Strongest factor for administrator accounts
Site administrators, course creators with broad category rights and any role that can change authentication settings should be required to enroll the strongest factor available, and should not be able to skip enrollment. Confirm which factors the installed MFA plugins allow for these roles and whether an admin can exempt themselves. Owner: the security lead sets the policy, and the Moodle administrator applies it to the admin role.
Audit logging of enrollment and reset events
Confirm that factor enrollment, removal, reset and failed verification are written to a log your security team can search, and that the logs leave the Moodle server on a schedule. Check retention against your own policy rather than the default, and test that a reset performed by a help desk agent is attributable to that agent. Owner: the security operations team, with the Moodle administrator configuring log export.
Interaction with the security report and locks
The Moodle security report and configuration locks described in the hardening pages should be reviewed together with MFA settings. Check that authentication plugin settings are locked where needed, so a site administrator cannot silently disable MFA, and that the security report does not flag a gap after rollout. Owner: the Moodle administrator, with a second reviewer from the security team signing off the final configuration.
Protection of recovery codes
Recovery codes, where the chosen plugin issues them, are a bypass route if they are stored or emailed in plain form. Confirm how codes are displayed, whether users are warned to store them securely, whether codes can be regenerated, and whether regeneration is logged. Check that no backup of the database or a support ticket exposes unused codes. Owner: the security team sets the handling rule, and the service desk confirms its scripts never request or record codes.
Monitoring after rollout
Plan a review of failed sign-ins, enrollment completion rates and reset volume for the first weeks after go-live, and agree thresholds that trigger investigation. A sudden rise in resets or in failures from one network range can indicate phishing or credential stuffing rather than a support problem. Owner: the security operations team owns the alerts, and the identity lead owns the response.
Exempting service accounts without weakening the rest of the site
Human staff and administrators hold the most powerful accounts on the site, so they are the last group to exempt from MFA. Any exemption here should be rare, recorded and treated as a privileged identity within your wider identity program.
- Exempt sparingly: Limit any exemption to named individuals with a written reason, and review the list each term.
- Keep administrator roles out of exemptions: Site administrator and role-management capabilities should keep the second factor, even when a teaching account is exempt.
- Restrict by network: If your release supports a network condition for an exemption, pair it with your campus or VPN ranges and test how it behaves behind your reverse proxy.
- Separate daily work from privileged use: Give administrators a second account for teaching and routine tasks so the privileged account is used only for administration.
Before relying on any exemption, confirm in the installed release whether it can be scoped to a role or a single user, whether it applies to SSO sign-ins, and whether changes to it are written to the site logs.
Learners are the largest group of accounts and the group where a blanket exemption removes the most protection. Most sites should not exempt learners at all. The practical questions are usually about setup windows, fallback factors for lost devices and how accounts without a personal phone are handled.
- Use time-limited windows instead of open exemptions: A defined setup window for new learners is easier to defend and review than an exemption with no end date.
- Plan recovery paths: Confirm which recovery options exist for a learner who loses a device, and who on the support team can reset them.
- Check for learners without a personal device: Some enrolment models include minors, external learners or people without a phone. Decide on an alternative factor or an assisted process for them before rollout.
- Decide on self-registered accounts: Set whether self-registered users must complete MFA before their first course access.
Test the sign-in flow with a learner account, including first login, a lost-device reset and sign-in through your identity provider, in the release you plan to run.
Integrations that call Moodle web services usually authenticate with a token rather than an interactive login, so MFA does not apply to them in the usual way. The protection moves to the token, the account behind it and the functions that account can reach.
- Use a dedicated integration user: Create one user per integration, with no interactive password use and no administrator role.
- Narrow the service scope: Limit each external service to the functions the integration needs, and review that list whenever the integration changes.
- Set token lifecycle rules: Confirm whether token validity can be set, rotate tokens on a documented schedule and revoke them when the integration owner leaves.
- Restrict by network: Where supported, allow token use only from the integration server's address range.
Confirm in the installed release how web service tokens are created, which functions each service can expose, whether expiry can be enforced and whether token use appears in the logs.
LTI launches and other external tools usually sign users in through a launch flow or an upstream identity provider. The question is where the second factor is enforced: in Moodle, in the tool or at the identity provider. Moodle core ships several authentication plugins, including LTI and OAuth 2, and the answer depends on how each tool is registered and configured. Review the core authentication plugins as part of this check.
- Map enforcement for each tool: Document whether MFA is enforced by Moodle, by the tool or by the identity provider.
- Limit who registers tools: A tool that receives launches from Moodle inherits the trust placed in it, so restrict which tools are registered and who can add them.
- Assess tool-side accounts: If a tool keeps local accounts, those accounts need their own MFA decision.
- Minimize passed data: Restrict the user fields and claims sent to each tool to what that tool needs.
Test each tool's launch with an account that has MFA enforced and one that does not, and confirm the outcome matches your written decision.
Automated sync accounts that bind to a directory or external database to create and update users never answer an MFA prompt. Their safety depends on the bind credential, the permissions the directory grants and whether the sync can assign roles that carry privileges or exemptions. Core ships LDAP and external database authentication plugins, so confirm which one your site uses before you apply these controls.
- Use a read-only bind: Give the bind account read access only to the attributes the sync needs.
- Keep privileged roles out of sync: Prevent the sync from assigning administrator or exemption-related roles, and make those assignments manually.
- Store and rotate the bind password: Keep the credential in your secrets system and rotate it on a documented schedule.
- Do not share the account: Keep the sync account separate from any human login or helpdesk task.
Confirm which role and profile fields the sync can write, and run a sync in a staging copy to check whether a newly created user inherits any exemption.
Limits to confirm in your environment before you commit
The Moodle MFA feature and its surrounding authentication stack change between releases, and several limits depend on your own identity provider and integrations. Treat each item below as a question to answer on a test site running your target version, not as a property you can assume from documentation.
Supported factor types per release
Confirm which second-factor types the installed release offers, such as TOTP, email codes, security keys or recovery codes, and which ones your policy requires. Factor availability and wording can change between releases, so check the release notes for the exact version you will run. Record the answer for your target version, because a factor you rely on in testing may be absent or renamed after an upgrade.
Moodle 5.1 notesEnforcement by role or cohort
Establish whether MFA enforcement can target specific roles, cohorts or groups, or only applies site-wide. Many campuses need staff and administrators covered first while students follow in a later wave, and a site-wide switch makes that phased rollout impossible. Test a learner, a teacher and an administrator account on the test site and confirm each one gets the prompt it should.
Mobile app and web services behaviour
Check how MFA interacts with the official Moodle app and with token-based web service access. Sessions created in the app or by external integrations may bypass, repeat or break the second-factor prompt, depending on configuration. Test sign-in on the mobile app, confirm that existing web service tokens keep working as you expect, and decide in writing how integrations are exempted or moved to a different credential.
SAML2 plugin compatibility
Confirm that the SAML2 plugin version you plan to use supports your target Moodle release, and that the identity provider is the one enforcing MFA for SSO users. The plugin directory lists the Moodle versions it supports, so check that range before you commit. Test the full login path, including the second factor, on the exact plugin and Moodle combination you will deploy.
SAML2 plugin listingUpgrade path across authentication code
Plan for the fact that authentication code and its settings can differ between major releases. Minimum upgrade versions, PHP and database requirements and removed components all affect whether your MFA configuration survives an upgrade intact. Read the release notes for each release between your current version and your target, and rerun your MFA test cases on a copy of production after every step.
Moodle 5.3 notesIdentity provider factor support
Ask whether your institution's identity provider can supply the second factor itself and pass the authentication strength to Moodle. If it can, Moodle may need to trust that claim rather than prompt again, which changes the user experience and the audit trail. Confirm this with your identity team and test the exact claim or assertion flow end to end before deciding where MFA is enforced.
Questions buyers ask before outside help on Moodle MFA
How much effort does a campus-wide Moodle MFA rollout take, and what drives it?
Effort depends mostly on how many user populations need different treatment, not on the MFA setting itself. Turning on the factors in Moodle is a small configuration task, but a campus rollout also involves deciding which roles must enrol, how long users get to set up a second factor, which exemptions apply and how the help desk handles lost devices. Each population with its own sign-in path, such as staff on a directory, students on self-registration and external examiners, adds testing and communication work. Ask any quote to break effort down by these populations and by the number of environments that need configuration, including staging and production.
Can our own team roll out Moodle MFA without an outside partner?
Yes, a team that already runs Moodle can enable and configure MFA in-house, provided it has someone who owns the Moodle site configuration and someone who owns the identity provider. The harder part is coordination: agreeing the policy, testing exemptions, briefing the help desk and handling the first wave of enrolment problems. Teams with a small administrator pool often use an outside partner for the pilot and the support runbook, then take over operations. Decide early which of these tasks your staff can absorb during the teaching term, because MFA changes tend to generate support tickets at the start of term.
What does the institution need to provide for an MFA rollout?
The work needs three inputs from your side. First, administrative access to the Moodle site and to the identity provider that the site uses, so that authentication settings and any SSO configuration can be tested. Second, a pilot group of real users from several roles, such as a few teachers, students and a service account owner, who can report problems before the wider release. Third, a brief for the help desk that explains enrolment steps, recovery options and escalation paths. Confirm in writing who approves the policy and who can change it after go-live.
How long does a Moodle MFA rollout typically take, and what sets that length?
Duration is set by the decisions made before any configuration starts, not by the technical switch. The main drivers are how many user groups need a separate policy, whether the identity provider changes are owned by another team with its own change calendar, how many rounds of pilot testing are needed, and when the rollout can land outside assessment periods. A rollout planned to avoid exam weeks and enrolment peaks takes longer on paper but produces fewer emergency changes. Ask for a timeline that lists each dependency and the team that owns it, and treat any duration without that list as provisional.
What should a quote for Moodle MFA support include?
A useful quote separates one-time work from recurring work. One-time items usually include the current-state review, the policy and factor decisions, configuration in each environment, exemption setup, the pilot, testing, the help desk brief and documentation. Recurring items include support during term starts, handling of exemption requests, and review after each Moodle upgrade, because the authentication settings and related plugins can change between releases. Ask the quote to state the environments covered, the number of user populations, what is excluded such as identity provider changes, and how post-launch support is priced.
How does MFA change when Moodle already uses SSO?
When sign-in already goes through an identity provider, MFA is usually enforced at the identity provider, and Moodle inherits it through the SSO flow. That moves most of the decisions to the identity team: which factors are allowed, how step-up rules apply to Moodle, and how session lifetimes interact with Moodle sessions. Moodle still needs its own review for accounts that do not use SSO, such as manual accounts, and for web service tokens, which do not follow the browser flow. Confirm that the identity provider policy applies to every login path into Moodle, including mobile apps and any direct database or LDAP-based accounts.
Which service accounts should be exempt from MFA on Moodle, and how should exemptions be managed?
Exemptions should be limited to accounts that cannot complete an interactive factor, such as integration or sync accounts, and each one should have a named owner, a documented reason and a review date. Shared or generic accounts are the usual source of trouble, so ask for them to be replaced where possible. Where an exemption is required, restrict it with network or token controls rather than with a blanket policy change. Ask your engineers to list every non-interactive path into Moodle before the policy is written, because missing one causes failures that look like MFA faults.
How DeployOpen scopes and delivers Moodle MFA rollouts
DeployOpen plans, implements and hands over Moodle multi-factor authentication inside the infrastructure you control, as a fixed-scope engagement agreed in writing before work starts. The work is sequenced so your identity, security and support teams can review each decision before it reaches learners.
How we scope
- Written scope covers which factors you enable, which roles and cohorts they apply to, and how SSO sign-in interacts with Moodle's own MFA prompts.
- We list the exemption rules for service accounts, web service tokens and integrations, with an owner and review date for each one.
- Scope includes the support model for a campus-wide rollout: help content, pilot cohorts, helpdesk escalation and the reset process learners will use.
How we build
- We configure and test the chosen factors on a staging copy of your Moodle site, using the same version and authentication settings as production.
- Combined SSO and MFA flows are tested end to end, including failure paths such as an expired factor, a lost device and an identity provider outage.
- Service account exemptions are built as narrowly scoped rules, then checked against the Moodle security report and your access review process.
How we hand over
- You receive configuration records, the exemption register, test results and a runbook for enrolling, resetting and removing factors.
- Administrators are walked through the settings, logs and reports they need to watch after go-live, so the rollout stays under your control.
- Pilot feedback, known limitations and any follow-up items are documented so your team can close them without us.
How we support
- Ongoing support, upgrades and continuous testing are available as retainers, including re-testing MFA after each Moodle minor release.
- A retainer can cover reviewing new exemption requests and changes to identity provider settings as your directory and policies evolve.
- Support terms, response expectations and the boundary between your team and ours are written into the agreement before work begins.

