Ministry of HealthMOH LearningKnowledge for better careManage platforms ↗

FOR PLATFORM ADMINISTRATORS

Connect your Moodle.
Bring learning into view.

One reusable connector publishes selected courses and safely hands learners to Moodle. The portal handles course discovery and central sign-in. Moodle continues to manage profiles, enrolment, learning records and certificates.

Download connector · 0.1.0 alpha ↓SHA-256 checksum

Moodle 5.2 · Verified locally on Moodle 5.2.3+ · PHP 8.3. Install one copy per Moodle site. The standard Moodle OAuth 2 authentication plugin is included in Moodle; no second custom authentication plugin is required.

1. Register your learning platform

A portal administrator first approves your Moodle origin in the server’s MOODLE_ORIGINS configuration, then opens Manage platforms and creates a connection. Copy the portal URL, site ID and private connection key. The key is displayed once.

2. Install the Moodle connector

Back up the Moodle database. Upload the ZIP through Site administration → Plugins → Install plugins, or extract learningportal/ into local/. On Moodle 5.2’s split-root layout the directory is public/local/learningportal. Complete Moodle’s upgrade screen or run its core CLI upgrade.

3. Connect central authentication

Create a confidential OpenID Connect client for this Moodle in the same identity realm as the portal. Enable Authorization Code flow and register the exact callback:

https://your-moodle.example.org/admin/oauth2callback.php

Disable password grants and service accounts. In Moodle → Server → OAuth 2 services, create the service with the client ID, client secret and HTTPS authorization, token and userinfo endpoints. Use scopes openid profile email. Enable the service for login and keep Require email verification enabled.

Identity claimMoodle user field
subusername
emailemail
given_namefirstname
family_namelastname

Enable Moodle’s built-in OAuth 2 authentication. The central realm must require verified email addresses and reject duplicate emails. Preserve an existing issuer ID when updating a connection: Moodle’s existing account links refer to it.

4. Save the connector settings

Open Site administration → Plugins → Local plugins → Learning portal. Enter the portal URL, site ID, connection key and Moodle OAuth service ID. Leave Local Docker development disabled on hosted sites. Keep all secrets on the servers.

5. Publish selected courses

Open Publish courses to the learning portal in Moodle’s Local plugins menu. Select courses and save. Hidden courses, hidden categories and the Moodle front page are excluded. This is metadata publication only; it does not enrol anyone.

6. Sync and test a learner journey

In portal administration, click Sync now. Subsequent syncs run every five minutes while the portal is running. Test a new learner, an existing Moodle account, an unenrolled learner and a learner with required profile fields. Open a course, sign in centrally, complete account confirmation if asked, then continue to the course.

Existing Moodle accounts are linked only after Moodle’s email confirmation. A new Moodle account is created from an already verified central identity without a second email verification. After confirming an existing account, use Continue to course on the confirmation screen or open the course again from the portal. The original Moodle account and its learning history remain in place.

How courses and accounts behave

Local development

The supplied local setup uses portal http://localhost:8090, identity service https://localhost:8443 and test email inbox http://localhost:8184. Trust the generated development CA in your browser before signing in. Keep this development configuration on your own machine. Full setup, backup, rollback and deployment details are in the project README.

Updating or disconnecting

Back up before upgrading. Install a newer connector ZIP and run Moodle’s upgrade. Keep the site ID, issuer ID and linked Moodle accounts. To pause publication, use Pause in portal administration. To replace a leaked key, use Replace key and update Moodle immediately. Disconnecting does not delete courses, accounts, enrolments or learning records.

Return to the learning portal →