Moodle and Google Workspace integration

Moodle connects to Google Workspace for Education through core features: the Google OAuth 2 service for sign-in, the Google Drive repository for files and Google Drive document conversion for assignment annotation. This page covers the method, prerequisites, admin consent steps and the failure points to plan for.

On this page

How Moodle and Google Workspace integration works in core

An institution running Moodle often needs two things from Google: teachers and students signing in with their Google accounts, and course activities that reach Google Drive files. Both are handled by Moodle core, with no third-party connector. The login side uses the OAuth 2 service templates for Google, which Moodle ships in its OAuth 2 service framework. The file side uses the core Google Drive repository plugin, so a teacher or student can pick a Drive file in the file picker, and the Google Drive document converter, which turns submissions into a format teachers can annotate. Each of these depends on an OAuth 2 service record that you create and configure in your own Moodle, so the design work starts with that record, not with the plugins themselves.

DeployOpen plans and configures these pieces inside the client's own Moodle, on the client's own servers, with the Google Cloud project and OAuth client owned by the institution. The step that most often delays a project is Google-side admin consent. Depending on how the Google Workspace for Education domain is set up, a super administrator may need to approve the OAuth client, approve the scopes that Drive access requires, and decide which organizational units can use it. Before you start, confirm with your Google Workspace administrator who holds that authority, which scopes the Moodle services will request, and whether any restrictions on third-party apps already apply to your domain. Those answers decide whether the build can proceed on schedule.

Plan the Moodle side alongside the Google side. Confirm which Moodle version you run and that the OAuth 2 service and repository plugins are enabled on it, since their settings pages differ between releases. Check the redirect URI that Moodle generates for each service and register it exactly in Google Cloud, because a mismatch is a common cause of failed sign-in. Then decide who may use each path: login for everyone, Drive browsing for staff only, or Drive document conversion for specific courses. Each of these choices changes what the Google side must approve, so settle them before the consent request is filed.

Which Moodle core features make up the integration

The Google connection in Moodle is four parallel components, not one switch. Each has its own configuration, its own users and its own admin steps, so a change to one does not automatically change the others. Plan them as separate work items with separate tests.

Google OAuth 2 service for login

Moodle core includes an OAuth 2 service template for Google. An administrator creates a service with a Google client ID and secret, and the OAuth 2 authentication plugin then lets users sign in with their Google account. Login is the only thing this changes. It does not create course memberships, and it does not give Moodle access to Drive files. Check how accounts are matched to existing Moodle users before enabling it.

OAuth 2 service templates

Google Drive repository plugin

The Google Drive repository plugin adds Drive to the Moodle file picker, so teachers and students can attach files from their Drive to course content and assignments. Access depends on the OAuth 2 connection and on each user granting permission for Moodle to read their files. Files are copied or linked at the moment they are chosen, so the file picker does not index or sync a whole Drive. Confirm which Drive scopes your Google setup requests and who may enable the repository.

Moodle repository code

Google Drive document converter

The Google Drive converter is used when a teacher annotates a submission as PDF in Moodle. Moodle sends the file to Google to convert it, then returns a PDF for feedback. It is a separate converter from the unoconv option that runs on your own server. Submitted student work leaves your infrastructure during conversion, which is the main privacy question for this card. Confirm the data handling and whether your institution allows it before enabling it.

File converter code

Admin consent on the Google side

The Google Cloud project, the OAuth consent screen and the redirect URI are configured in Google's console, not in Moodle. For Google Workspace for Education, a Workspace administrator decides which apps users may authorize and can restrict them to your domain. Without this consent work, the Moodle settings will look correct but sign-in or Drive access will fail. Ask your Workspace administrator who owns the project and how changes are approved.

How a Google sign-in and Drive request flow through Moodle

The flow starts in the user's browser, which sends the sign-in request to Moodle, and Moodle hands the user to Google's OAuth 2 endpoints. Google returns control to Moodle, which holds the tokens and makes Drive requests on the user's behalf. Document conversion for annotation is the other hand-off, and it can run on Google's side or on the institution's own converter. Check where each hop sends data and which side of the trust boundary each system sits on.

Sign-in, Drive access and conversion cross the boundary between Moodle and Google.

What you need before configuring Google in Moodle

Google sign-in, Google Drive files and Google-based document conversion each depend on a few decisions made before anyone opens an admin page. The cards below cover the tenant, the Google Cloud project, the Moodle version and server stack, the public address Moodle presents to Google, and the converter settings. Confirm each Google console step against Google's current documentation, because its screens change more often than Moodle's.

Google Workspace for Education tenant

Confirm which Google Workspace for Education tenant holds your staff and student accounts, and who holds super administrator rights in it. Consent for the Moodle OAuth client and for Drive access is granted by a Google administrator, so a teacher cannot finish the setup alone. Check whether your domain restricts third-party app access, since that policy can block the Moodle client before any Moodle setting is tried. Ask the Google administrator for a named account that will own the integration.

Google Cloud project for OAuth credentials

Moodle's Google login needs an OAuth 2.0 client ID and client secret created in a Google Cloud project. Decide who owns that project, where it is billed, and how its credentials are rotated and recorded. Confirm the consent screen settings, user type and scopes with Google's current documentation. Store the client secret in your secrets process, not in a shared spreadsheet.

Moodle version and server stack

Pin the Moodle version before choosing Google settings, because the supported PHP, database and web server combinations change by release. Moodle 5.1 requires 64-bit PHP 8.2 or later, and sites must be on Moodle 4.2.3 or later to upgrade to it. Moodle 5.3 requires 64-bit PHP 8.3 or later and PostgreSQL 17, and sites must run Moodle 4.4 or later to upgrade. From Moodle 5.1 the web server document root must point to the public directory.

Moodle 5.3 notes

Public HTTPS address and redirect URI

Google redirects users back to Moodle at an address you register in the Google console, so that address must match the one Moodle uses exactly, including scheme, host and path. Decide the public hostname, the certificate it uses, and whether Moodle sits behind a reverse proxy or load balancer that changes the address Moodle sees. A mismatch typically shows as a redirect error during first sign-in, so test it on a staging site first.

Google Drive repository settings

The Google Drive repository plugin lets users pick files from Drive inside Moodle, and it needs its own access granted through the same Google client. Decide which users may use the repository, whether teachers may share Drive files with students, and which Drive scopes you accept. Review the repository plugin code in your Moodle version before enabling it, since the repository is part of core Moodle.

Repository source code

Document converter and privacy choice

Assignment annotation as PDF can use the Google Drive converter or the unoconv converter that runs on your own server. Choosing the Google Drive converter sends submitted files to Google for conversion, which must be assessed against your data handling rules before enabling it. Confirm which converter is active, which file types it handles, and how failed conversions are reported to teachers.

File converter source code

Configuring Google OAuth 2, Drive and converters in order

This sequence connects Moodle to Google Workspace in a fixed order: first the OAuth 2 service, then admin consent, then sign-in, the Drive repository and the Drive converter. Each step closes with a check, so a failure is traced to one component rather than the whole integration.

  1. Create the Google OAuth 2 service from the template

    A Moodle administrator opens the OAuth 2 services page under site administration and creates a service from the Google template that core Moodle provides. The service holds the scopes and endpoints that Moodle will request from Google, so it must exist before any credentials are entered. Confirm that the service appears in the list with a Google issuer and is still disabled. Do not enable it yet, because the client credentials come next.

  2. Register the client credentials in Google Cloud

    In the Google Cloud console for your organization, a project owner creates an OAuth client and adds the redirect URI that Moodle displays on the service page. Copy the client ID and client secret into the Moodle service. Confirm the redirect URI matches your Moodle site URL exactly, including protocol and path, because a mismatch is the most common cause of failed sign-in later. Store the secret in your secrets process, not in a shared spreadsheet.

  3. Complete admin consent in Google Workspace

    A Google Workspace super administrator reviews the requested scopes for the OAuth client and grants consent for the organizational unit or the whole domain, depending on your access model. Without this step, users see a consent block or the Drive repository cannot read files. Record who approved which scopes and when. Confirm in the Google Workspace admin console that the client appears as authorized, then ask one test user to attempt a sign-in before going further.

  4. Enable Google sign-in as an authentication method

    Enable the Google service in Moodle and then turn on the OAuth 2 authentication method under site administration. Set the account creation and matching rules deliberately, because they decide whether a Google login links to an existing Moodle account or creates a new one. Test with a staff account and a student account separately. Confirm that each test user lands in the expected Moodle profile and that a user outside the approved domain is refused.

  5. Enable the Google Drive repository plugin

    Under the repository management pages, enable the Google Drive repository plugin that ships in Moodle core and set its use to the OAuth 2 service you configured. Decide which user roles can see the repository in the file picker, since that controls who can attach Drive files to courses and assignments. Confirm by having a teacher open a file picker in a test course, authorize Drive, and attach a test file. The check is a file appearing in the activity with its original name.

  6. Enable the Google Drive document converter

    Under the file converter settings, enable the Google Drive converter that ships in Moodle core, and check the order of converters so that the intended one runs first for annotation. The converter sends submitted documents to Google to produce a PDF that teachers can annotate, so the privacy trade-off with an on-server converter should be reviewed and recorded before this step is closed. Confirm by submitting a test Word document to an assignment with annotation enabled and checking that the grader sees a converted PDF.

  7. Test each path and record the results

    Run one scripted pass with a staff account and a student account covering sign-in, Drive file attachment and annotated submission. Repeat the Drive and converter tests after a Moodle minor update, since OAuth service behaviour and plugin settings can change across releases. Record each result, the Moodle version, and the Google account used. The integration is ready for users when every path passes in the test course and the log shows no authorization or conversion errors.

How Google account fields map to Moodle user profiles

This table compares the Google identity claims an admin typically works with against the Moodle user fields they feed, and the decision each one needs. Read it as a checklist to confirm against your installed Moodle version and your Google Workspace domain settings before you enable login. The main takeaway is that domain restriction and username rules are admin decisions to make before the first sign-in, because changing them later affects existing accounts.

Google identity claimMoodle user field it usually feedsDecision the admin must make
Email addressEmail address, and often the basis for account matchingWhether a matching existing account is linked by email, and how duplicate emails are handled
Primary domain or hosted domainUsed to limit sign-in to approved accounts through the service configurationWhich Workspace domains are allowed, and whether personal Google accounts are excluded
Given name and family nameFirst name and last nameWhether names are overwritten at each login or only set when the account is created
Stable subject identifierExternal identifier stored against the user, not the usernameConfirm the installed version stores it for matching so renamed or changed emails do not create duplicate accounts
Local part of the email addressUsername, if the admin chooses to derive itWhether usernames follow the email prefix, and how collisions between staff and students are resolved
Profile picture or locale (if released)Profile picture or language preferenceWhether these are synchronized or left to users; confirm availability in your version first

Security controls for Google sign-in and Drive access

Google sign-in and Drive access give anyone with a linked account a path into Moodle files and student work, so the controls sit at three points: who can sign in, who holds the credentials, and what leaves the site. The cards below cover those points and the review steps that keep them working after launch.

Restrict sign-in to your Google domain

Moodle's Google OAuth 2 service accepts any Google account unless you limit it. Set the allowed domain in the Google sign-in configuration so that only accounts in your Google Workspace domain can create or match Moodle users, and confirm that personal Gmail addresses are refused in a test login. Also decide whether new accounts are created automatically or only matched to existing users, because that choice controls who gets a Moodle account at all.

OAuth 2 service templates

Protect the OAuth client secret

The Google OAuth client secret lets any holder impersonate your Moodle site to Google. Store it only in the Moodle service configuration, limit administrator access to that page, and rotate the secret in the Google Cloud console if an administrator leaves or a backup copy is exposed. Keep database backups and site exports under the same access rules as the live database, since the secret is stored there.

Limit which roles can link Drive

The Google Drive repository lets users attach their own Drive files to courses and assignments. Decide which roles can add the repository to a user's file picker, and review the repository instance settings so that only the roles that need Drive access hold it. Student access should be a deliberate choice for each course, because linked accounts can read and share files that the student owns in Drive.

Review what the converter sends to Google

The Google Drive converter uploads submitted files to Google so that Google can render them as PDF for annotation. Student submissions can contain personal data, health details or unpublished work, so ask your data protection lead to approve that flow before enabling it. Confirm which file types are sent, how long Google keeps copies under your agreement, and whether your Google Workspace terms cover student data. The unoconv option keeps conversion on your own server, which is covered in the sibling document conversion topic.

Log and review consent grants

Each user who links Drive or signs in with Google grants access that remains in place until it is revoked. Review the consent grants in your Google Workspace admin console on a regular schedule, remove access for leavers, and check that the OAuth app is limited to the scopes Moodle needs. Keep a record of who approved the app and when, so an auditor can match each grant to a documented decision.

Why Google login and Drive fail after setup

This table lists the failures that most often appear after Google sign-in, the Drive repository or the Drive converter goes live, with the likely cause and fix for each. Read it as a first triage list, then confirm the exact error in the Moodle logs and the Google Cloud console before changing settings.

SymptomLikely causeFix to check first
Redirect URI mismatch on Google sign-inThe redirect URI registered in the Google Cloud OAuth client does not match the callback URL of the Moodle OAuth 2 service, often because of a changed hostname, http versus https, or a trailing slash.Copy the callback URL from the Moodle OAuth 2 service page exactly into the Google OAuth client, then retest sign-in from a private browser window.
Consent not granted by the Workspace adminThe consent screen is set to internal or restricted, and the Google Workspace administrator has not approved the scopes Moodle requests, so users see an access blocked message.Ask the Workspace admin to review the requested scopes and approve the app for the organizational unit that holds Moodle users.
Domain restriction blocks usersThe Google Cloud project is limited to one Workspace domain, or the Moodle site accepts only certain email domains, so users from an alias or secondary domain are refused.Confirm which domains the OAuth client and the Moodle authentication settings allow, and add any secondary domains the organization actually uses.
Duplicate accounts after an email changeThe Google account is matched to Moodle users by email address, so a renamed or re-issued address creates a second Moodle account and splits the user's course history.Decide the matching key before go-live, merge duplicates with the Moodle account merge process, and keep an operational rule for email changes.
Drive repository not visible to usersThe Google Drive repository plugin is not enabled for the site, the user has not authorized Drive access through Google, or the Moodle context hides the repository in the file picker.Enable the repository in Moodle, confirm the user has granted Drive scopes, and test the file picker in a course where the user holds the right role.
Converter jobs stuck or failingThe Google Drive converter requires a working Google token and the Drive API, and jobs stall when the token expires, the scope was not granted, or the file type is not supported by the converter.Check the file conversion task queue and the scheduled tasks, confirm the Drive API is enabled for the project, and reauthorize the converter account before retrying.
Exact error not identifiedSymptoms look alike across login, repository and converter, so the team changes several settings at once without knowing which one fixed the problem.Read the Moodle site logs and the OAuth 2 and task logs for the failing request, then match the error text in the Google Cloud console audit and OAuth consent pages.

Questions buyers ask before configuring Google in Moodle

How much effort does connecting Moodle to Google Workspace take?

The effort depends mainly on how many Google services you connect and how many Google Cloud and Workspace settings your team must set by hand. Login through the Google OAuth 2 service is the smallest piece: it needs a Google Cloud project, an OAuth client with the redirect address from your Moodle site, and an OAuth 2 service configured in Moodle. The Google Drive repository and the Google Drive document converter add more steps, because each depends on scopes, consent and testing with real accounts. Ask any partner for a written scope that lists each service, each Moodle site (test and production) and each test account type, then price from that list.

Can our internal team configure Google in Moodle without outside help?

Yes, if you have someone comfortable with Moodle site administration and a Google Cloud administrator who can create OAuth credentials and manage consent. The core steps are documented in Moodle's own OAuth 2 and repository settings, so a capable Moodle administrator can follow them. The risk sits in the details: wrong redirect addresses, unverified consent screens, scopes that users are not granted, and settings that differ between a test site and production. An outside team adds most value when you want a documented, tested configuration handed over with a rollback plan.

What do Google Workspace admins need to provide?

Google Workspace admins need to approve the Google Cloud project, create or confirm the OAuth client, decide which user groups may sign in with Google, and allow the Drive scopes that Moodle requests. They also need to decide whether teachers and students use personal or organization accounts, because Google Workspace for Education policies can limit third-party app access. Ask your admins to confirm in writing which apps, scopes and organizational units they will approve before testing starts, since a late refusal of one scope can change the design.

How long should we plan for admin consent and testing?

Plan for admin consent and testing as a separate phase with its own owner, because its length depends on your Google admins' review process, not on Moodle. Consent requests wait on people outside the project team, and they can stall when a scope needs a security review. Testing should cover a staging Moodle site with test accounts for each role, including students, teachers and managers, and should check login, account matching, Drive file selection and the document converter for annotated PDFs. Ask your partner or internal lead to set milestones based on your own approval cycle rather than on a generic duration.

Does connecting Google Workspace change how we upgrade Moodle?

Connecting Google Workspace adds settings and external dependencies that you must re-check at each Moodle upgrade, but it does not usually change the upgrade path itself. Moodle core ships the OAuth 2 service templates, the Google Drive repository and the document converters, so they are updated with each release. Your Google Cloud project, OAuth client, redirect addresses and consent screen remain outside Moodle, and a change in Google's APIs or policies can affect them between Moodle upgrades. Add these checks to your upgrade test plan and confirm the current requirements in the Moodle release notes for your target version.

Is the Google Drive document converter safe for student work?

The Google Drive converter sends submitted files to Google to convert them, so it is a data handling decision as well as a configuration step. Check your privacy notices, your Google Workspace data terms and your institution's rules on student records before enabling it. The alternative is a converter that runs on your own server, which keeps files inside your infrastructure but adds server packages to maintain. The trade-offs are covered in the page on document conversion, and your compliance lead should sign off on the choice.

What does ongoing maintenance of the Google connection look like?

Ongoing maintenance covers keeping OAuth credentials valid, watching for expired or revoked consent, reviewing Google Cloud and Workspace policy changes, and retesting after each Moodle minor release. Credentials and consent are recurring checks, while the initial build is one-time work. Ask for a runbook that names who renews the OAuth client secret, who approves new scopes, and how account mismatches or failed logins are reported. If you use a retainer for Moodle support, confirm whether it covers Google-side changes as well as Moodle-side fixes.

What changes for teachers and students after rollout

The most visible change is sign-in. Once Google sign-in is enabled through Moodle's OAuth 2 authentication, users choose their Google account on the login page instead of typing a Moodle password. Teachers and students should expect a Google account chooser the first time they sign in, and they will need to know which Google account to use if their institution runs more than one domain. Before go-live, confirm with the Google administrator whether personal Google accounts can sign in, and tell users what happens to any existing Moodle password. Moodle accounts created before the switch keep their usernames, so matching rules decide whether a returning user lands in the right account.

In assignments and course resources, the change shows up in the file picker. Once the Google Drive repository is enabled for the relevant users, teachers can attach files from Drive when building a resource, and students can submit files from Drive when an assignment allows it. Tell students which file types the assignment accepts and whether Drive links or uploaded copies are graded. For annotation, the institution should decide whether teachers will mark up submissions in the browser. That depends on the document converter setup, so confirm which converter is active and test a Word and a PDF submission with a teacher account before the course term starts.

Course design and grading stay the same. Teachers still build courses, set assignment due dates, write rubrics and enter marks in the same Moodle screens, and the gradebook does not change because the sign-in method changed. What does change is the file path: a file in Drive is a copy or link, so teachers should not expect edits made in Drive to reach a student's submission. Communicate that difference, the sign-in change, the support route for account problems and the date from which Google sign-in applies. A short notice to students and a teacher briefing a week before go-live usually prevents the most common support tickets.

Scope, delivery and support for Moodle and Google integration

A fixed-scope engagement covers a defined set of work: confirming the Google Workspace for Education tenant and its admin console settings, creating the Google Cloud OAuth 2 client, configuring the Google OAuth 2 service in Moodle for login, enabling and scoping the Google Drive repository plugin, and setting up Google Drive document conversion for assignment annotation. The scope, deliverables and timeline are agreed in writing before work starts, and a quote follows from that written scope.

  • Written scope: the list of Moodle sites, Google domains, user groups and features in scope, with anything excluded named explicitly.
  • Admin consent steps: who in your organization must approve the OAuth client and the Drive scopes, and the sequence in which they do it.
  • Test evidence: login, repository browsing and annotated PDF checks run with test accounts, with results delivered in writing.
  • Handover: configuration notes, a record of the settings changed and the operator steps for future changes.
  • Change control: how requests that fall outside the agreed scope are priced and approved.

Before signing, confirm which Google accounts and Moodle sites are covered and who on your side owns the Google Workspace admin console.

How DeployOpen delivers Moodle and Google Workspace integration

DeployOpen scopes, builds, tests and documents Moodle and Google Workspace integration inside infrastructure you control, covering Google sign-in, the Google Drive repository and document conversion for annotation. Engagements are fixed-scope, with the scope, deliverables and timeline agreed in writing before work starts. Ongoing support is available as a retainer.

How we scope

  • Confirm your Google Workspace for Education tenant, domains and which admin consent steps your administrators can approve
  • Record which Google services Moodle will use for login, file picking and conversion, and who owns each setting
  • Agree in writing which Moodle release and PHP and database versions the integration will target
  • Document the account matching rules, data flows and privacy questions your compliance team needs answered

How we build

  • Configure the Google OAuth 2 service in Moodle with the client credentials and redirect settings from your Google project
  • Set up the Google Drive repository plugin with the permissions and user scopes your policy allows
  • Configure Google Drive document conversion for assignment annotation, or document the unoconv alternative where Google is not an option
  • Test sign-in, file picking, conversion and failure handling with representative test accounts before rollout

How we hand over

  • Deliver a configuration record listing each OAuth 2 service, scope, redirect address and admin consent decision
  • Provide runbooks for rotating client secrets, handling revoked consent and diagnosing failed document conversions
  • Document the test cases used and the results, so your team can repeat them after each Moodle upgrade
  • Walk your administrators through the settings and the evidence they may need for a security review

How we support

  • Review the integration when you plan a Moodle upgrade, since OAuth 2 and repository settings may need retesting
  • Track changes in Google Workspace admin policies that could affect sign-in or file access
  • Offer ongoing support, upgrades and continuous testing as a retainer, priced from the written scope
  • Retest after material changes so the documented configuration stays accurate

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.