Moodle NTLM SSO on Windows networks

Moodle's LDAP plugin includes an NTLM SSO option for transparent sign-in on domain-joined Windows machines. This page covers what it needs, how it is configured and when SAML or OAuth 2 is the better choice.

On this page

How Moodle NTLM SSO works and when Windows networks need it

Picture a university or company whose staff already sign in to Windows every morning and now expect Moodle to recognize them without a second password prompt. Moodle's LDAP authentication plugin includes a New Technology LAN Manager (NTLM) SSO option that does this for domain-joined users, so sign-in can happen transparently when a user opens the site from a managed Windows machine. The option is not a single switch. It depends on three layers working together: the directory that holds the accounts, the web server that receives the NTLM handshake and passes the verified identity to Moodle, and the browser on each machine, which must be willing to send Windows credentials to the Moodle site.

Because the behavior spans those layers, the first task is to confirm the exact option names, the web server modules and the browser settings that match the Moodle version you run, since these details are version-dependent and should be checked against the Moodle release in use and the LDAP authentication language strings in the core code. Ask your team to document which accounts Moodle will match against, which Windows domain and host names users will reach, and what happens for users on unmanaged devices. Those answers decide whether NTLM fits your network at all, and they also show where a failure will appear first.

NTLM is a Windows-era challenge-response protocol, and it does not carry the federation features that newer identity standards provide. Many sites therefore weigh NTLM SSO against SAML 2.0 or OAuth 2 through an identity provider, which handle browsers, mobile devices and external users more predictably. The core authentication plugins include OAuth 2 and the SAML2 plugin is widely used, so compare the options before committing. Choose NTLM when the network is single-domain, the users are all on managed Windows machines and the team can maintain the web server and browser configuration. Choose an identity provider route when access must cover phones, external learners or several domains.

Configuration options and when each fits

This table compares four ways to sign users into Moodle from a Windows network: LDAP password sign-in, NTLM SSO through the LDAP plugin, SAML 2.0 through the SAML2 plugin, and OAuth 2 through the core OAuth 2 authentication. Read each row against your own directory, browser fleet and web server, then use the fit column to shortlist options before you test them. The main takeaway is that NTLM SSO only helps domain-joined Windows clients on the internal network, so most sites that also serve remote or non-Windows users will need a federated option alongside it.

OptionSign-in experienceInfrastructure and client requirementsTypical fit
LDAP password sign-inUsers type their directory username and password on the Moodle login page each session.Moodle can bind to the directory over LDAP or LDAPS. Browsers need no special settings and any client works.Mixed or external users where simplicity matters more than seamless access, or as a fallback during a migration.
NTLM SSO (LDAP plugin option)Domain-joined Windows users sign in transparently, with no password prompt, when the browser trusts the Moodle site.Web server must pass NTLM authentication through to Moodle. Each browser must be set to send Windows credentials to the Moodle host. Clients must be domain-joined Windows machines on the network.Internal Windows-only campuses or offices that accept the server and browser configuration work and do not need off-network sign-in.
SAML 2.0 (SAML2 plugin)Users are redirected to the organization's identity provider and return signed in, with a standard browser flow on any device.An identity provider that issues SAML assertions, a Moodle service provider configuration, and attribute mapping agreed in advance. Confirm plugin version support against your Moodle release.Organizations that need web sign-in for remote, mobile or non-Windows users and already run a SAML-capable identity provider.
OAuth 2 (core OAuth 2 authentication)Users are redirected to an OAuth 2 or OpenID Connect provider and sign in with its login experience, often with a single sign-on session.An OAuth 2 or OIDC provider, a registered client with redirect URLs, and HTTPS on the Moodle site. Check the provider types the core plugin supports for your release.Organizations standardizing on a cloud or self-hosted OAuth 2 or OIDC identity provider, or those whose identity tools favor OIDC over SAML.
Choice for Windows-only internal useTransparent sign-in inside the network, with a separate login path for off-network access.Plan the web server and browser settings as a per-host configuration that security and desktop teams both sign off on.Pick NTLM SSO only when the environment is closed, and keep a federated option in the design if the Moodle site will later serve other clients.

Setup sequence for NTLM SSO with checks at each stage

This sequence takes a Moodle site from a verified directory connection to transparent sign-in for domain-joined Windows machines, with a check after each stage so that a fault is found where it was introduced. Confirm each option name and setting against the Moodle version you run, since the exact labels and dependencies can change between releases.

  1. Confirm the directory and the LDAP bind account

    Before touching Moodle, the directory team confirms the domain controllers that Moodle will query, the base contexts that hold user accounts, and a dedicated, read-only bind account with a password policy that suits a service account. Ask them to confirm whether LDAPS is available, since the bind credentials should not travel in clear text. Check the bind from the Moodle server using a standard LDAP query tool, and confirm that the query returns the test user's attributes. This step is done when the bind succeeds and the test user is found under the expected context.

  2. Configure the LDAP authentication plugin and field mapping

    A Moodle administrator enables the LDAP server authentication plugin, enters the host URL, bind user and contexts, and sets the user attribute that holds the login name, which is usually the account name that Windows users type. Map the first name, last name, email and any other fields Moodle needs, and confirm the user type and search scope settings. Then run a manual sign-in test with a domain account and a wrong password to confirm both the accept and reject paths. This step is done when a domain user can sign in with a password through the LDAP plugin and the account is created with the expected profile fields.

  3. Enable the NTLM SSO option in the LDAP plugin

    In the LDAP plugin settings, a Moodle administrator switches on the NTLM SSO option, which Moodle's language strings describe as the New Technology LAN Manager single sign-on setting. Confirm which user attribute carries the Windows login name, because the NTLM value passed to Moodle must match the account name that the LDAP lookup expects. Save the settings and keep the password login available as a fallback during testing. This step is done when the setting is saved and the site still accepts the earlier password sign-in, which proves the plugin has not broken existing access.

  4. Configure the web server for Windows authentication

    The web server administrator enables Windows integrated authentication on the Moodle virtual host, using the module or feature that matches the server software in use, and makes sure the authentication headers reach PHP. On Moodle 5.1 and later, point the document root at the new /public directory rather than the main Moodle folder, since otherwise the site may show directory listings or errors. Restart the web server and confirm that the Moodle login path is the one that receives the authentication challenge. This step is done when a request to the site returns the expected authentication exchange and the document root serves the Moodle front page.

  5. Verify sign-in from a domain-joined machine

    A tester signs in from a Windows machine that is joined to the domain, using a browser that is not yet configured through policy, and then again after the browser settings are in place. The tester confirms whether the browser prompts for credentials or signs in silently, and records the account that Moodle assigns to the session. Check that the user's profile fields came from the directory and that a second user on the same machine is handled as expected. This step is done when the test user reaches the Moodle dashboard without a password prompt, or the tester has recorded exactly where the chain breaks.

  6. Set browser trusted sites and integrated authentication through group policy

    The Windows administrator adds the Moodle hostname to the local intranet or trusted sites zone and enables automatic logon with the current user's name and password for that zone, typically through group policy so that every domain machine receives the same setting. Confirm the policy applies on a test machine using a policy result report, and confirm that the browser in use honors the zone settings. Make sure the site address matches exactly what users type, including any alias used for the site. This step is done when the policy is applied and a fresh browser session on a domain machine signs in without a prompt.

  7. Test sign-in from a machine outside the domain

    A tester signs in from a machine that is not domain-joined, from a network segment outside the intranet zone, and from a domain machine where the policy has been removed. The expected result is a standard login form or a credentials prompt, with the password path still working for the account. This check confirms that the NTLM option does not expose the site to unexpected sign-ins and that external users keep a usable route in. This step is done when each test produces the expected outcome and the results are recorded for the operations team.

Security and operational risks of NTLM on Moodle

NTLM sign-in on Moodle moves trust from the browser to the web server and the directory behind it. The cards below cover the protocol weaknesses, the header handling that makes or breaks the setup, and the logging, patching and account lifecycle work that keeps it safe after go-live.

Protocol weaknesses and trust boundary

NTLM is an older Microsoft authentication protocol with known weaknesses, so it should not be treated as a strong control on its own. Serve Moodle only over HTTPS and keep the NTLM-enabled site reachable from the intranet only, not from the internet. Confirm with the security team whether NTLM is permitted by your own policy at all before any configuration work starts.

Spoofed usernames from untrusted clients

NTLM SSO relies on the web server passing an authenticated username to PHP. If a client can send that header or variable directly, it can claim to be any user. Check that the reverse proxy strips inbound copies of the authentication variable and that only the Windows-authenticated path sets it. Test this with a request that carries a forged username from outside the trusted network.

Logging failures and password fallback

Users who fail NTLM sign-in are often sent to the normal Moodle login form, which means password attempts happen on the same site. Log failed NTLM attempts at the web server and in Moodle, and review fallback logins for unusual volumes or accounts. Record which fallback path each user takes so that support requests can be traced.

Patching Moodle and plugins

The LDAP plugin, the web server modules that handle Windows authentication, and Moodle itself all need regular updates. Track the Moodle security support dates for your installed branch and schedule plugin updates alongside core releases. Keep a record of which plugin versions run in production so that a security advisory can be matched to your site quickly.

Sessions and directory changes

Single sign-on can keep a session alive after a person leaves or is disabled in Active Directory, because Windows sign-in no longer prompts for a password. Set the LDAP user sync to suspend removed accounts, and confirm the session lifetime that applies to Moodle sessions created through NTLM. Test a disabled account against a live session before go-live.

Security review of the protocol choice

Before building NTLM SSO, ask the security team to review the protocol choice against current policy, the browser and network scope, and the fallback design. If the review favors a modern standard, a SAML or OAuth 2 setup usually gives clearer assertions and logout behavior. Document the decision and the owner of the review.

Why many sites now prefer SAML or OAuth 2 for Windows users

For many organizations, the better long-term route for Windows users is to sign in through an identity provider over SAML 2.0 or OAuth 2 rather than through NTLM negotiated by the web server. With the SAML2 Single sign on plugin (auth_saml2, maintained by Catalyst IT), Moodle trusts tokens issued by your identity provider, and the plugin's listed support covers Moodle 2.7 through 5.1, so confirm compatibility against the version you plan to run. The core OAuth 2 authentication plugin works the same way with a provider that supports it. In both cases the identity provider, not the web server, decides whether a user is who they claim to be. That lets you apply multi-factor authentication, conditional access rules based on device or location, and session policies that NTLM passthrough cannot express.

The deciding factor is usually the identity provider you already run. If your directory is Microsoft Entra ID, the Entra ID guidance in the sibling topic on OAuth 2 or SAML2 covers account matching and group-based access. If your directory is on-premises Active Directory and you have no federation service, the LDAP and Active Directory sibling topic explains how to connect Moodle directly, including the bind account, LDAPS and the user sync task. Before choosing, ask your identity team which protocols your provider supports, which MFA and conditional access policies already apply to staff, and who owns the certificates and metadata that a SAML or OAuth 2 setup depends on. Those answers often settle the question faster than comparing the plugins.

The NTLM option in the LDAP plugin remains a valid choice where you need transparent sign-in for domain-joined machines and cannot yet change the identity architecture, but it ties Moodle's sign-in to the web server's Windows support and to browser settings on every client. Plan a migration path from the start: record which users and browsers depend on NTLM, confirm that your chosen replacement covers the same accounts, and test the switch with a pilot group before removing the NTLM configuration. Whichever route you pick, verify it with a supervised login and logout test, a check that suspended accounts cannot sign in, and a review of the Moodle authentication settings during each upgrade.

Questions buyers ask about Moodle NTLM SSO

What does a Moodle NTLM SSO setup cost and what drives the price?

The cost is the labor to configure the LDAP plugin's NTLM SSO option, the web server and browser changes, testing across the browsers your users run, and documentation and handover. No figure is supplied here, so ask for a quote built from a written scope. Price moves with the number of domains and forests involved, whether the web server already runs Windows integrated authentication, how many browsers and client builds must be tested, whether a Moodle upgrade is pending, and whether the work also covers SAML or OAuth 2 as a fallback. Most engagements are fixed-scope, so the quote should list each deliverable and what the client provides. Ask which parts are one-time work and which recur, such as retesting after browser or Moodle updates.

How long does a Moodle NTLM SSO setup take?

Duration depends on the state of your environment, not only on the plugin settings. No timeline is supplied here, so confirm the estimate in writing. The main drivers are how quickly your team can deliver a service account and directory access, whether the Moodle host and its web server can be changed in a maintenance window, how many browser and operating system combinations must work, and how long testing with real domain-joined machines takes. A pilot group before wider rollout adds time but reduces rework. Ask the partner to show which steps depend on your team and which on the partner, so delays can be tracked.

What must our internal team provide before the work starts?

Your team provides the directory and web server access needed to do the work safely. Typical inputs include a read-only bind account in Active Directory, the LDAP or LDAPS endpoint details, the domain and realm names, access to the web server configuration that handles Windows integrated authentication, and a test group of domain-joined machines and browsers. Group Policy is often needed to add the Moodle site to the local intranet zone and to allow automatic credential sending in supported browsers, so a Group Policy administrator should be in the scope discussion. Ask the partner to list each input, its owner and the date it is needed.

Can an internal administrator set up NTLM SSO alone?

A competent Moodle administrator can configure the LDAP plugin, but NTLM SSO also depends on web server settings and browser policy, which often sit with other teams. The work is usually shared. The Moodle admin handles the auth_ldap settings and testing, a web server administrator changes the Windows authentication module and the document root, and a directory or desktop team adjusts browser policy. A single person can cover all three roles only if they already hold access to each system. Ask any partner to state which steps they perform, which steps your staff perform, and what knowledge transfer is included.

Is NTLM still the recommended choice compared with SAML or OAuth 2?

For most new deployments, SAML 2.0 or OAuth 2 is the stronger choice, and NTLM SSO is generally kept for existing Windows-only networks. NTLM is an older challenge-response protocol tied to Windows credentials, and it works best on domain-joined machines inside the corporate network. Browsers and networks differ in how they negotiate it, and it does not extend cleanly to remote users, mobile devices or partner access. Moodle core ships OAuth 2 and other options, and the SAML2 single sign-on plugin (auth_saml2) is commonly used with identity providers. Ask your security team to compare the options against your remote access and multi-factor requirements before committing.

What is needed after go-live to keep NTLM SSO working?

After go-live, the setup needs regular checks because browser policy, web server updates, Moodle upgrades and directory changes can each break sign-in silently. Plan for testing after each browser major release, after web server and PHP updates, before each Moodle upgrade, and when the bind account password, domain or LDAP endpoint changes. Retest the sign-in path on each supported browser after any of these changes. Ask the partner whether post-go-live support is a separate retainer, what response they commit to in writing, and who owns the runbook. Moodle's own release schedule, published on its releases page, helps you plan these checks in advance.

What should we ask for in a written NTLM SSO scope?

A written scope should name the Moodle version, web server and browser list in use, the directory and domain layout, and each deliverable with its acceptance test. Ask the partner to state how fallback login will work for users who fail SSO, how the bind account is secured and rotated, what logs are kept for failed sign-ins, and which Group Policy and web server changes are included. Also ask whether a pilot group and a retest are included, who signs off each stage, and what documentation and handover your team receives. Clear answers here usually matter more than the headline quote.

How a domain-joined browser reaches Moodle through the NTLM path

The flow starts in a domain-joined browser on the intranet, which sends its Windows credentials to the web server during the sign-in request. The web server's Windows authentication module passes the username to PHP, which Moodle's LDAP plugin uses to look up the matching directory account and create or reuse a Moodle user session. Check at the web server and browser layers first, and confirm that external users who arrive from outside the intranet are routed to the normal password form, which sits on the other side of the trust boundary.

Intranet NTLM sign-in path, with external users falling back to password sign-in.

How DeployOpen scopes and delivers Moodle SSO work

DeployOpen treats Moodle NTLM SSO on Windows networks as a written, fixed-scope piece of work inside your own infrastructure. We confirm the web server, Active Directory and browser setup first, then build, test and document the sign-in path so your identity and security teams can review it.

How we scope

  • Review your Moodle version, web server, PHP setup and whether the LDAP plugin's NTLM option fits your network.
  • Map domain-joined client machines, browser policies and the intranet and HTTPS hostnames Moodle will be reached on.
  • Agree in writing whether NTLM SSO is the right fit or whether SAML or OAuth 2 should be scoped instead.

How we build

  • Configure the LDAP authentication plugin and its NTLM SSO settings against your domain and service account.
  • Set web server authentication handling and browser trust settings for the Moodle site, documented per client group.
  • Test sign-in from managed and unmanaged machines, including fallback login, failed domain lookups and session expiry.

How we hand over

  • Deliver configuration records, browser policy notes and a test script your team can repeat after each change.
  • Walk your identity and platform engineers through the sign-in flow, the logs to check and the known limits of NTLM.
  • Document the decision record for NTLM, including the migration path to SAML or OAuth 2 if you choose it later.

How we support

  • Support is available as a retainer covering Moodle upgrades, plugin updates and regression tests of the sign-in path.
  • Retest the sign-in flow after Moodle point releases, web server changes and Active Directory domain changes.
  • Confirm with your security team how NTLM support is tracked, reviewed and retired as your sign-in standard evolves.

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.