
Connecting Your LMS to HR Systems and SSO: A Moodle Guide
Connecting your LMS to the HR system and single sign-on turns a training platform from a separate site run on spreadsheets into part of the employee lifecycle: a new hire finds their account and mandatory courses ready, a transfer changes their learning paths, and a leaver's access closes the same day. This guide is for HR, L&D and IT teams in Saudi Arabia and the UAE running or planning Moodle. It covers SSO options, syncing employees and org structure, auto-enrolment by job and department, and sending results back to HR.
SSO is not provisioning: separate the two problems
Single sign-on answers one question at login: who are you? Provisioning answers the questions that come before it: who should have an account, in which department, enrolled in which courses, and when the account should close. Many projects stop at SSO and then find that accounts appear only on first login with empty department fields, and that leavers can still sign in. Microsoft's documentation draws the same line: standards such as SAML and OpenID Connect for sign-in, and automatic provisioning to create, update and deactivate accounts.
Decide the source of truth for each field
The HR system is the reference for employment data: employee number, department, job title, manager, branch, hire date and status. The identity provider, whether Microsoft Entra ID, Active Directory or Google Workspace, is the reference for sign-in identity and email. The LMS receives from both and is the source for neither.
The most common chain: HR, then the identity provider, then Moodle
In many organisations, employee data flows from the HR system to the identity provider and from there to applications. Microsoft Entra ID offers this out of the box with SAP SuccessFactors: it creates accounts for new hires, updates title and manager, and disables accounts on termination, according to Microsoft's tutorial. It also supports API-driven provisioning from any HR system, and cloud HR integration requires a Microsoft Entra ID P1 or P2 licence, as set out in Microsoft's cloud HR provisioning plan.
SSO options in Moodle
Moodle ships with several authentication methods in core, complemented by well-known community plugins. The right one is decided by the identity provider you already run, not by the platform team's preference.
OAuth 2 and OpenID Connect, built into core
OAuth 2 authentication adds login buttons for Google, Microsoft, Facebook, LinkedIn and others. Creating an account on first login is enabled by default; you can prevent it, in which case users are asked to link the login to an existing account with the same email. If the provider is OpenID Connect compliant, entering its base URL lets Moodle discover the rest, and you can restrict logins to specific email domains, according to the OAuth 2 services page.
Microsoft Entra ID
There are two routes. The first is the Microsoft service in core OAuth 2: you register an app in the Azure portal, the callback URL must be HTTPS, and to bring in department and job title you change the userinfo endpoint to request department and jobTitle from Microsoft Graph, as Moodle's documentation explains. The second is the open-source Microsoft 365 plugin set (local_o365 with auth_oidc), which adds user sync and Teams integration, according to Microsoft's guide.
Google Workspace
Google is one of the ready-made OAuth 2 service templates. Restrict logins to your company domain with the login domains setting, and note that the allowed and denied email domains in authentication settings are checked only when an account is created, whereas the login domain restriction applies at every login, as the OAuth 2 services page notes.
SAML 2.0 with ADFS, Okta or Entra
The common route is the SAML2 Single sign on plugin maintained by Catalyst IT. It runs SAML entirely inside Moodle, usually needs only the identity provider's metadata pasted in and Moodle's metadata handed to the IdP admin, and supports attribute-to-field mapping, optional automatic account creation and a mix of SSO and manual logins.
LDAP and on-premise Active Directory
LDAP authentication is part of core and suits organisations still running Active Directory on their own network. The documentation recommends sAMAccountName so staff sign in with their domain username, and notes that with Active Directory some operations, such as changing passwords or updating data from Moodle, require an encrypted LDAPS connection.
Syncing employees and org structure from HR
First decide what you actually need: employee number, name, email, department, job title or job code, manager, branch, hire date and status. Moodle has institution and department fields built in; anything else becomes a custom profile field, which then appears in the mapping screens. Do not copy personal data that training does not need. This is one of the first things we review on any project in our Moodle LMS development work.
From Active Directory over LDAP
The scheduled LDAP users sync job creates, updates, suspends and deletes accounts, and the 'Removed ext user' setting decides what happens to people removed from the directory: keep, suspend or full delete. The documentation warns against enabling the job before the settings are verified and a backup is taken, since a misconfiguration can delete users wrongly.
From Microsoft Entra ID with the Microsoft 365 plugins
Sync runs with Moodle's cron, once a day by default, and can be scheduled more often. It creates and updates accounts, suspends or deletes those removed from Entra, and a 'User Creation Restriction' limits sync to users with a given value in a field, such as one department, according to Moodle's documentation. The advantage: accounts are ready and enrolled before the first login.
Directly from the HR system
When the identity provider does not carry employment data, an integration job reads changes from the HR system and writes them into Moodle through its web services, such as core_user_create_users, core_user_update_users and core_cohort_add_cohort_members (Moodle's service list). In SAP SuccessFactors the data comes from OData APIs such as PerPerson, EmpJob and FODepartment (SAP). For Oracle HCM, Oracle recommends HCM Extracts for bulk extraction and Atom feeds to detect changes rather than polling. In Odoo, the employee record carries department, job position and manager (Odoo). Jisr describes itself as API-first (Jisr), so confirm which APIs your subscription includes.
CSV uploads as a stopgap
Upload users accepts columns for the authentication method, for custom profile fields as profile_field_ columns and for cohorts as cohort1, with an option to add new users and update existing ones. The docs stress the auth column for LDAP and similar users; without it, accounts are created as manual and their owners cannot log in. Fine for a pilot, not as a permanent solution.
Auto-enrolment by job and department
The goal is rules HR can read without asking IT: every new hire in the Riyadh branch is enrolled in induction and safety, everyone in finance in the anti-money-laundering course. In Moodle these rules are usually built from cohorts.
Cohort sync into courses
The cohort sync enrolment method links a cohort to a course: members added to the cohort are enrolled automatically, members removed are unenrolled, and members can be placed in a course group. If cohorts mirror departments and jobs, enrolment becomes a direct result of HR data.
Filling cohorts automatically from profile fields
In core, cohorts are filled manually, by file upload or through web services. The Profile field based cohort membership plugin adds rules that set cohort membership from custom profile fields, and Enrol by user profile fields enrols users in courses directly from profile values, such as values coming from LDAP. Both are community plugins, so check support for your version.
Write the rules matrix before choosing a tool
One table: department, job or branch in one column, mandatory and optional courses in the next. Then answer the transfer cases: if someone moves from sales to finance, are they unenrolled from sales courses, and what happens to their completion record? Test the answer on a staging site before turning sync on in production.
Sending training results back to HR
A one-way integration is half the job: HR wants completions, scores and certificates in the employee file, and sometimes in performance reviews. For what is worth measuring in the first place, see our article on measuring corporate e-learning success.
Scheduled custom reports
The custom reports builder creates reports from sources such as Course participants, which includes course completion, sets the audience by role or cohort, and schedules delivery by email, in CSV by default. A quick option when HR is happy to import a periodic file.
Moodle web services
For an automated link, the integration job reads completion status with core_completion_get_course_completion_status, or a whole custom report with core_reportbuilder_retrieve_report (service list), then writes the result into the HR system through its API.
What to send
Employee number as the key, course code, completion date, grade, and certificate number and expiry if any. That is usually enough; detailed activity logs do not need to travel to the HR system.
A pre-launch checklist
These points prevent most of the problems that surface in the first week after an integration goes live.
A stable matching key
Use the employee number as the key and store it in Moodle's idnumber field. Email addresses change with marriage, domain changes or restructuring, and when email is the key you get duplicate accounts and lost training history.
Start with a small scope
Microsoft recommends testing mappings on a few users with scoping filters before a full sync (Microsoft), and Moodle's LDAP documentation recommends a backup before enabling sync. Apply the same rule: one department first.
Suspend leavers, do not delete them
A full delete removes the user's data from Moodle, and Moodle's documentation warns to be careful with it. Suspending blocks access while keeping the training record you may need for an audit or a later dispute.
A fallback login
Keep a manual administrator account that works when the identity provider is down. The SAML2 plugin, for example, supports dual login, with a URL parameter that bypasses SSO for manual accounts (plugin page).
Planning to connect your training platform to HR and SSO?
N.I.T Egypt has built Moodle platforms for organisations in Egypt and the Gulf since 2013. To propose a clear approach, we need: your identity provider, your HR system and version, the number of employees and branches, the mandatory programmes per department, and what HR wants back. Send them through get a quote, or contact us to review your current platform. For background, read Moodle for corporate training.
Frequently asked questions
Does Moodle need plugins for Microsoft or Google sign-in?
Not for sign-in itself, since OAuth 2 is part of core. User sync from Entra and Teams integration need the Microsoft 365 plugin set, as Moodle's documentation explains.
Does Moodle support SAML?
The core authentication list includes Shibboleth, but the usual route with ADFS, Entra or Okta is Catalyst IT's SAML2 plugin, which runs SAML inside Moodle without a separate application. Check that its release supports your Moodle version before upgrading.
Is SSO enough to create accounts?
Only to create an account at first login. The account will not be enrolled before then, and it will not close automatically when the employee leaves unless you add sync from the identity provider or the HR system.
Can we connect Jisr or other regional HR systems?
Yes, if the system exposes APIs in your subscription, or through your identity provider if it already receives employee data from it. Either way, we start by reading the API documentation and testing the connection before committing to scope.
What happens to an employee's training record after they leave?
It depends on the sync setting: suspending keeps the record and blocks access, a full delete erases it. Choose suspension unless your data-retention policy requires otherwise.
Need a Moodle platform or eCommerce app?
We'll send you a detailed proposal within 24 hours