Moodle and Clever SSO for K-12 schools

A planning guide for signing K-12 students and teachers into self-hosted Moodle through Clever's OAuth 2 service, with account matching, rostering boundaries and privacy controls.

On this page

How Moodle sign-in through Clever works for K-12 schools

If your students and teachers already sign in to Clever, you will want the same accounts to open Moodle without a second password. Moodle core includes a Clever OAuth 2 service template alongside its Google, Microsoft and other templates, so Clever login is available without a third-party plugin. The thing to plan for is that Clever login is a sign-in method, not a complete roster. It tells Moodle who is signing in and can create or match an account at that moment, but it does not decide which courses a student belongs to, which cohort a teacher manages, or when an account should be suspended.

In practice, the OAuth 2 service is registered in Moodle's OAuth 2 services screen with the Clever client details your district application uses, and the Clever authentication plugin is then enabled under site administration. When a user clicks the Clever button, Clever authenticates them and returns identity fields to Moodle, which then matches the person to an existing Moodle account or creates one under the rules you set. Confirm the exact fields Clever returns for your district, the redirect URL you must register, and whether your district application needs approval before teachers and students can use it, because those details come from your Clever dashboard and the Moodle OAuth 2 documentation for your version, not from this page.

Decide early how matching works. If usernames or email addresses in Clever do not exactly match the identifiers already in Moodle, you will get duplicate accounts or students locked out of courses they should see. Test with a small set of teacher and student accounts, check that course enrolments survive the first login, and agree with your student information system owner which system is the source of truth for enrolment. Rostering and deprovisioning still need their own process, which is covered in the sections on account matching and rostering.

What you need before configuring Clever login in Moodle

Clever login depends on decisions made before anyone opens the Moodle admin settings: which Moodle release you run, how the site is served, and which Clever app and test school you will use. Confirm these six items first, because each one changes what the OAuth 2 setup and the account matching look like.

Moodle release and server stack

Confirm the exact Moodle release your site runs before choosing settings, because PHP and database requirements differ by version. For Moodle 5.1, the release notes require 64-bit PHP 8.2 or later (8.3 and 8.4 supported) and PostgreSQL 15, MySQL 8.4, MariaDB 10.11 or SQL Server 2017 or later. For Moodle 5.3, the requirements rise to 64-bit PHP 8.3 or later and PostgreSQL 17, MySQL 8.4, MariaDB 11.4 or SQL Server 2019 or later. Check your own version against the matching release notes before you plan a change.

Moodle 5.1 notes

Clever app registration

Clever login needs an app registered with Clever, which gives you the client credentials Moodle stores in its OAuth 2 service. Confirm who on your side can create or approve the app, whether it is registered for a developer account or a district, and which Clever permissions the school agrees to. Record the client ID and secret in your secrets store, not in a shared document, because they are the trust anchor for every sign-in.

HTTPS and the correct web root

Clever sends users back to Moodle over HTTPS, so the site must present a valid certificate on the exact hostname you register. On Moodle 5.1 and later, the web server document root must point to the public directory inside the Moodle code, not the main Moodle folder. Otherwise the site may show directory listings or errors during the redirect. Test the login path on the production hostname before the school pilot starts.

Agreed redirect URL

The redirect URL registered with Clever must match the callback Moodle generates for its OAuth 2 issuer, character for character, including protocol, host and path. Agree the exact value with the people who own the Clever app and the Moodle hostname, and write it into the change record. A mismatch between a trailing slash, a subdomain or an old hostname is one of the most common causes of a failed first sign-in.

Test tenant or sandbox school

Use a Clever test or sandbox school with dummy student and teacher accounts before connecting real rosters. The test set should include users who match on the chosen field, users who do not match, and a teacher account with the same name as a student. This lets you verify account matching, duplicate handling and role assignment without exposing student records. Ask Clever which test environment is available for your app and which accounts it provides.

Rostering source and data owner

Confirm which student information system feeds Clever and who owns the roster data, because Clever login only signs users in and does not create the course membership. Agree which identifier the school treats as stable, such as a student number or Clever user ID, and who approves changes to it. Record the owner of the roster feed so that a sync problem reaches the right person quickly.

Configuring the Clever OAuth 2 service and login in Moodle

This sequence turns Moodle's core Clever OAuth 2 template into a working sign-in method, with the redirect URL agreed on both sides and a pilot teacher and student confirmed before wider rollout.

  1. Confirm the Clever application and credentials

    Before touching Moodle, the Clever administrator confirms that the district has a Clever application registered for this Moodle site and that the person doing the configuration can see the client ID and client secret. Ask Clever's current developer documentation which portal screens and roles apply to your district, because these change over time. Store the secret in your organization's password manager or secrets store, not in a ticket or email thread. The step is done when both values are in hand and the district contact has confirmed which Clever sections (students, teachers, sections) the application may read.

  2. Create the OAuth 2 service from the Clever template

    A Moodle administrator opens site administration, finds the OAuth 2 services page, and adds a new service using the Clever template that ships in Moodle core, alongside the Google and Microsoft templates. Leave the service name and template fields as the template provides unless your naming standard requires a change. Saving the service creates the record that the authentication method will reference. The check is that the service appears in the list of OAuth 2 services with the Clever issuer details populated from the template, and no error is shown on save.

  3. Enter the client ID and secret in Moodle

    The Moodle administrator pastes the client ID and client secret issued by Clever into the matching fields of the OAuth 2 service and saves again. Confirm the values were copied exactly, including any trailing characters, because a single mistake produces a failed token exchange that looks like a general login error. Restrict who can view this screen, since the secret grants the ability to act as the application. The check is a saved service with both values present and the secret masked on reload.

  4. Set the redirect URL in Clever

    Moodle displays the redirect URL that the Clever service expects for this site. Copy it exactly, including the protocol and path, and enter it in the redirect settings of the Clever application. The Clever administrator then saves the application. The redirect URL must match the Moodle site address used by students and teachers, so confirm the site's public web address first. The check is that the redirect URL shown in Moodle and the one registered in Clever are identical, character for character.

  5. Enable the Clever authentication method

    In Moodle's authentication settings, a site administrator enables the Clever method so it appears on the login page, and sets the rules that decide whether new accounts are created on first sign-in or only existing accounts may use Clever. Decide this with the district before enabling, because it affects who can create accounts. Keep manual login available for the pilot so administrators can recover access if the external service is unavailable. The check is that the Clever option appears on the login page for a test browser session.

  6. Match pilot accounts to existing Moodle users

    Before a wider rollout, check how Clever identities map to Moodle accounts. Choose a pilot teacher and a pilot student whose Moodle accounts already exist, and confirm which field Moodle uses to match them, typically the username or email address supplied by Clever. Where a match fails, review the field mapping rather than creating duplicate accounts. Duplicate accounts are hard to merge later, so resolve mismatches before any bulk sign-in. The check is that each pilot user signs in through Clever and lands on the existing account, with no new account created.

  7. Test sign-in with pilot teacher and student

    The pilot teacher and student each sign in through the Clever option from a clean browser session, and then a Moodle administrator checks the user records, course enrolments and recent authentication logs. Test the failure path too, for example with a user who has no Moodle account, so the team knows what the learner sees. Record any errors with timestamps and the redirect details, and fix them before expanding. The sequence is complete when both pilot users sign in, see the courses they expect, and the logs show successful Clever authentications without unexplained errors.

Where Clever login ends and rostering from the SIS begins

Signing a student or teacher in through Clever proves who they are, but it does not put them in a course. A Clever login returns an identity and a set of profile attributes to Moodle, and Moodle's OAuth 2 authentication creates or matches the account. Course enrolments, cohorts and groups are a separate job. Plan that second job before go-live, because a teacher who signs in successfully will still land in an empty course list until something places them in the right classes. Ask your Clever administrator which roster objects (sections, teachers and students) are synced to Clever and which fields they carry, and confirm the exact field names in your own setup rather than assuming them.

Class and section data usually reaches Clever from the student information system (SIS) through the SIS's Clever integration or a rostering sync, so Clever holds the school's sections and their membership. Moodle does not read that roster through the login flow. The Moodle side has three typical options. A rostering or enrolment plugin can pull section membership from an external source, which keeps enrolments current but requires credentials, a schedule and a decision about who may write to course membership. Cohorts can be filled by a scheduled job or by hand, which is simpler to start with but adds an ongoing manual step each term. Manual enrolment by teachers is the lowest setup cost and the highest drift risk. Each option has a different owner, so name one before the first term.

Write the decision down with your Clever and SIS administrators before pilot. Specify the roster fields you rely on, the term and section identifiers that link a Moodle course to a class, how students who transfer mid-term are removed, and who handles accounts that Clever returns without a matching Moodle user. An illustrative case: a teacher's login works but a section is missing because the SIS sync did not include it, and no one owns the fix. Test one full term's changes in a non-production Moodle site before relying on the roster path. Also confirm with the vendor how often roster data refreshes, since that interval sets how long a schedule change can take to appear in Moodle.

Mapping Clever identity fields to Moodle user accounts

This table compares each Clever identity field with the Moodle account field it should populate, and notes whether the value is set when the account is created or refreshed at each login. Read it as a starting design to confirm against the Clever OAuth 2 service template in your Moodle version, since field availability differs by release and by what your Clever integration exposes.

Clever fieldMoodle fieldWhen it is setWhat to confirm
Clever user identifierAuth identifier (external ID) for the OAuth 2 issuer linkAt account creation, then used to match returning usersConfirm the template returns a stable ID that does not change when a student changes section
Email addressEmail address and account matching keySet at creation, refreshed at login if the template supplies itCheck whether teachers and students have unique district emails and decide which field wins on conflict
First nameFirst nameSet at creation, updated at each login if mappedConfirm whether your data owner allows Moodle to overwrite names edited locally
Last nameLast nameSet at creation, updated at each login if mappedConfirm the same overwrite rule as first name
Role (student, teacher or other)Cohort or system role assignmentApplied at login or by a sync job, depending on your rulesMap roles to Moodle roles deliberately, since teacher roles carry grading and course permissions
School identifierCohort or institution field, or course categoryUsually at creation or by sync, not as a login fieldConfirm the Clever school ID is exposed to Moodle and decide whether it drives cohorts or only reporting
Section identifierCourse enrolment via cohort or enrolment pluginChanges as rosters change, so it is refreshed by a sync rather than at loginConfirm which system owns enrolments: Clever rostering, your student information system, or Moodle
Authentication methodAuth plugin set to OAuth 2 with the Clever issuerSet when the account is created through CleverDecide how existing manual accounts are converted without creating duplicates

Matching Clever logins to existing Moodle accounts

The account-matching rules are the decision that matters most in a Clever rollout, and they should be settled before go-live because the first login from Clever can attach to the wrong Moodle account. Most schools arrive with accounts that were not created by Clever: manual accounts typed in by a teacher, self-registered accounts, accounts loaded from an earlier CSV import, and accounts created by a previous SSO connection. Each of these can hold the same student or teacher under a different username, email address or name spelling. Before enabling the Clever OAuth 2 service in Moodle, export the current user table with the identifiers each account carries and sort the records into groups: exact matches, probable duplicates, and orphans with no counterpart in the student information system or Clever roster.

Choose the stable key before anything else. Moodle's account matching depends on the identifier that Clever sends for each user, and that identifier must not change when a student changes a surname, a teacher changes a name, or a teacher's school email address is reissued. Names are the weakest candidate. Confirm with your Clever administrator which user field the integration returns and whether it is stable across rostering syncs, and then confirm how the matching field is mapped into Moodle's user profile. Decide in writing what happens to each category above: which accounts are linked automatically, which are linked only after review, which are suspended, and which are deleted. For teachers with two email addresses, decide which address is authoritative and whether the second address is kept as a secondary identifier.

Set the approval path for changes before go-live, not after the first complaint. Name one owner for the matching rules, usually the Moodle administrator working with the district's data or records lead, and require a second person to approve any bulk merge, suspension or deletion. Record every manual link decision with the requester, approver and date so that the district can later show how an account came to hold a student's records. This record matters because FERPA requires institutions to keep a record of each disclosure of personally identifiable information, and a wrongly merged account can expose one student's grades to another. Ask Clever and your Moodle partner how unmatched accounts are reported, whether they are suspended or left active, and how a removed student's course history is preserved under your retention schedule.

Protecting student data in a Clever-connected Moodle

Clever sign-in puts student and teacher identities on a path that touches your Moodle site, so the controls around it matter as much as the login itself. The cards below cover the Moodle settings, logging and documentation that a school or district should review, and the federal rules that determine which obligations apply.

Restrict OAuth 2 secrets to administrators

The Clever OAuth 2 service in Moodle holds the client credentials that let your site trust Clever's sign-in responses. Limit who can view or edit the service and its secret to a small group of site administrators, and keep that group out of routine teacher support roles. Record who changed the service, and rotate the secret through the Clever dashboard if an administrator account is compromised or leaves the school.

OAuth 2 service templates

Limit which roles can sign in through Clever

Clever authenticates everyone with a Clever account, but Moodle decides what that person can do. Confirm which Clever user types (students, teachers, staff) are matched to Moodle accounts, and do not let a Clever login create administrator or site-wide manager rights. Review role assignments after each rostering run so that a change in the student information system cannot silently grant elevated access.

Keep a manual fallback login for administrators

If Clever is unavailable, misconfigured or revoked, administrators still need a way into Moodle. Keep at least one named administrator account that signs in with a local password and multi-factor authentication where your identity policy allows it. Test that fallback login on a schedule, and store its credentials in a controlled location that is separate from the Clever configuration.

Enforce HTTPS and secure cookies

Sign-in redirects, OAuth 2 tokens and session cookies all cross the network, so the Moodle site must serve every page over HTTPS. Check that the site URL in Moodle uses https, that session cookies are marked secure, and that plain HTTP requests redirect rather than serve login pages. Confirm the certificate chain and renewal process with your infrastructure team before go-live.

Review sign-in and account change logs

Clever sign-ins and Moodle account creation or changes are only useful as evidence if someone reads them. Review Moodle's logs for authentication events, new accounts, suspended accounts and role changes on a set schedule, and set an alert path for unexpected administrator activity. Keep log retention aligned with the retention period your school policy sets for account records.

Document data flows and obligations

Write down which student and teacher fields move from the student information system to Clever, from Clever into Moodle, and into any reports or backups. Under FERPA, a vendor or contractor can receive education records as a school official only under direct institutional control and with access limited to legitimate educational interests, so record who holds each role. COPPA duties apply to children under 13, including a written security program and a retention policy. The GLBA Safeguards Rule applies only if your institution is a Title IV participant. Confirm which of these apply with your counsel before go-live.

34 CFR Part 99

How a Clever sign-in reaches a Moodle account

The flow starts when a student or teacher opens the Moodle login page and chooses Clever. Moodle redirects the browser to Clever, which asks the user to approve the request and sends an authorization code back to Moodle's callback. Moodle then exchanges that code, server to server, for an access token, reads the profile fields it needs, and matches the user to an existing account or creates one. Course enrolments do not travel through this path. They come from a separate roster process fed by the student information system. Check where each trust boundary is crossed and which profile fields leave Clever.

Sign-in and roster paths into Moodle, with trust boundaries marked.

Why Clever login fails in Moodle and how to fix it

This table lists the failures admins most often hit when signing K-12 users into Moodle through Clever, with the likely cause, the fix and the first check to run. Work down the rows in order, since a redirect or secret problem blocks every user while a missing role or enrolment affects only some.

FailureLikely causeFirst check and fix
Redirect URL mismatchThe redirect URI registered in the Clever developer portal does not exactly match the OAuth 2 callback URL generated by the Moodle Clever service.Compare both values character by character, including scheme, host, path and trailing slash, then correct the registered URI in Clever.
Wrong client secretThe client ID or secret was copied from the wrong app, pasted with extra spaces, or rotated in Clever without updating Moodle.Re-enter the client ID and secret in the Moodle OAuth 2 service, then test a single known teacher account.
HTTPS or proxy header problemsMoodle sees plain HTTP behind a reverse proxy or load balancer, so the callback is built with the wrong scheme or the session cookie is rejected.Check the wwwroot setting and the forwarded protocol headers at the proxy, and confirm the site is reached over HTTPS only.
Duplicate accounts after matchingClever user IDs or email addresses did not match an existing Moodle account, so a second account was created for the same person.Search Moodle for the user by email and by Clever ID, merge or suspend the duplicate, and fix the matching field in the auth configuration.
Users with no role mappedClever section or role data does not map to a Moodle system role, so the user signs in with no teacher or student capability.Check the role mapping for each Clever user type in Moodle, then sign in as one affected user and confirm their system role.
Missing email blocks account creationThe Clever record has no email address, and account creation depends on email as a required field.Identify records without email in the Clever data, correct them at the source system, then retry the sign-in for the affected user.
Signed in but not enrolledThe user authenticates successfully, but rostering or enrolment sync did not add them to the course, so the dashboard shows no courses.Check the enrolment sync task log and the user's course enrolments in Moodle, then rerun the sync for that section.

Questions districts ask before configuring Clever with Moodle

How much effort does configuring Clever login for Moodle take?

The effort depends mainly on how many schools and roster sources are involved, how much account clean-up the existing Moodle site needs, and how many testing windows the district can schedule. A single school with one clean roster source is a small configuration job. A district with several schools, duplicate accounts from earlier imports, or inconsistent student identifiers needs more design and testing time before go-live. Ask any partner for a written scope that lists schools, user counts, roster sources, test accounts and the number of test rounds included, since those items drive the quote more than the Moodle settings themselves.

Can a school configure Clever with Moodle without a partner?

Yes, a single site with a clear roster source and an administrator comfortable with Moodle authentication settings can often do the work in-house. The core OAuth 2 service template for Clever ships in Moodle core, so the configuration itself is not a custom build. The harder cases are multiple districts or sites sharing one Moodle, existing accounts that must be matched to Clever identities, and roster data that does not agree across systems. In those cases, a partner can help define matching rules and test plans, but the district still owns the decisions about who gets access.

What does the work need from our team?

Plan for access and time from four groups: a Clever administrator who can register the application and approve the connection, your student information system contact who can confirm identifiers and roster exports, a Moodle administrator who can create the OAuth 2 issuer and authentication settings, and a named owner who signs off test results. You also need a test window with non-production accounts before student or teacher logins are switched on. Ask your vendor or partner to confirm in writing which of these roles they expect you to fill and which they will perform.

How is account matching decided between Clever and Moodle?

Account matching is a design decision made before configuration, not a setting you discover afterward. Decide which stable identifier links a Clever user to a Moodle user, such as an email address, a student number or a Clever user ID stored on the Moodle account, and decide what happens when no match is found, such as creating a new account or holding the login for review. Duplicate accounts from earlier manual imports are the most common source of problems here. Clean them up and document the matching rule before the first test login.

Does Clever login replace rostering from our student information system?

No. Signing in through Clever only controls how users authenticate. It does not, by itself, decide which students belong to which course or cohort. Course enrolment and group membership still need a rostering source, which is usually the student information system exported through Clever or a separate sync, and that source must be designed alongside the login. A school that expects logins to create correct course memberships automatically should confirm that the roster feed and the Moodle enrolment method are both in scope and tested together.

What compliance review should we request before go-live?

Ask for a review against the federal student privacy rule in 34 CFR Part 99 if your district receives federal education funds, because it governs who may access education records and how disclosures are logged. If your learners include children under 13, ask about the COPPA Rule in 16 CFR Part 312, including the written information security program and data retention policy it requires. Ask your vendor and partner to show how they handle school official designation for any outside party with access to records, and how access is limited to legitimate educational interests. Your counsel or privacy officer should confirm which rules apply to your district.

What should we ask for in a written quote?

Ask for a scope that names each school and user population, the roster sources and identifiers in use, the account matching rule and clean-up work, the test plan and number of test rounds, and what is handed over at the end. Separate one-time configuration from recurring support, upgrades and any retesting after Moodle releases. Because Moodle ships new releases on a fixed schedule, ask how the Clever configuration will be checked after each upgrade you plan to take. Ask who is responsible for Clever and Moodle administrator access after the engagement ends.

How DeployOpen scopes and supports a Clever SSO project

DeployOpen fixes the scope in writing before any configuration starts, and for a Clever project that document has to pin down several things that are easy to leave vague. The first is the Moodle release and hosting: the team confirms the exact version, the PHP and database versions it runs on, and whether the site is self-hosted or managed, because the Clever OAuth 2 service is configured in Moodle's own OAuth 2 services screen and the callback address must match the site's public URL. The second is the Clever side: which Clever app the school district has created, which scopes it requests, which schools and sections are in the roster, and who at the district holds the admin rights needed to approve the app. The third is the matching rule set, meaning how a Clever user ID, email address or student number maps to an existing Moodle account, what happens when two records match, and which fields are mapped during account creation. The written scope also lists the test plan, the privacy evidence the school asks for, and who signs off each item.

Delivery is fixed-scope, so the quote follows from the agreed list of components, environments and test cases rather than from an open-ended hourly estimate. A typical sequence runs configuration in a staging copy of the site, a pilot with a small set of teachers and students across the grades in scope, and then go-live checks that confirm sign-in for each role, correct course and cohort membership, and that a rejected or unmatched account is handled as the policy says. The pilot results and the privacy evidence, including how the school's records are handled under FERPA, are delivered as documents the district can review. Ask any provider whether they will deliver a retest after fixes and who owns the Clever app credentials after handover. DeployOpen does not issue audit reports or certifications, so the school should plan any independent review with its own auditor. Ongoing support after go-live, including upgrades for new Moodle releases and periodic checks of the Clever connection, is available as a retainer.

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.