Lab Overview
In Labs 1–4, we set up the Moodle LMS, created courses, configured the AusJournal CCSP badge, and built the certification workflow. A major barrier for global learners, however, remains the registration process.
In this lab, we will eliminate that friction entirely by integrating Google OAuth2 into your Moodle site. Learners will be able to sign in with their existing Google account in a single click — no form, no email verification, no waiting.
Learning Objectives
- Understand why registration friction causes learner drop-off
- Configure Google Cloud Console to generate OAuth2 credentials
- Connect Google OAuth2 to Moodle's authentication system
- Test the Google Sign-In button on the Moodle login page
- Integrate the login system with the AusJournal badge and LinkedIn workflow
The Problem
Without OAuth2, a new global learner must complete these steps before starting any course:
| # | Action Required | Drop-off Risk |
|---|---|---|
| 1 | Fill in registration form | High — many abandon here |
| 2 | Check email for verification link | Very High — spam folders, delays |
| 3 | Click verification link and log in | Medium — extra step |
| 4 | Search for and find the course | Medium — confusing for new users |
| 5 | Click Enrol and pay | High — momentum is lost by now |
Research shows up to 70% of potential learners abandon registration before completing it. Every extra step costs enrolments and revenue.
The Solution
With Google OAuth2 enabled, the entire flow becomes:
Google OAuth2 is completely free of charge. It does not use Google Cloud credits and requires no billing account for standard website usage.
Open Google Cloud Console
Open your browser and navigate to:
https://console.cloud.google.comYou will see the Google Cloud Console welcome screen with your project already created.
The $300 free credit banner is for Google Cloud services such as virtual machines and databases — NOT for OAuth2 login. You can safely dismiss it. Google Sign-In will never cost anything.
Navigate to APIs and Services
Use the hamburger menu (top-left three lines) and navigate to APIs and Services > Credentials.
Do NOT enable the Identity Toolkit API if it appears — that is a Firebase enterprise service and is not needed for Moodle OAuth2 login.
The Credentials Page
You will land on the Credentials page showing API Keys and OAuth 2.0 Client IDs sections — both empty at this stage.
Configure the OAuth Consent Screen
Click the yellow banner button Configure consent screen. Fill in:
| Field | Value |
|---|---|
| User Type | External (allows any Google account) |
| App name | CyberPritam Learning |
| User support email | Your Gmail address |
| Developer contact email | Your Gmail address |
| All other fields | Leave blank — click Save and Continue |
Create OAuth Client ID
Go back to Credentials and click + Create Credentials > OAuth client ID. Fill in exactly:
| Field | Value |
|---|---|
| Application type | Web application |
| Name | Moodle Google Login |
| Authorised JavaScript origins | https://cyberpritam.com |
| Authorised redirect URIs | https://cyberpritam.com/admin/oauth2callback.php |
The redirect URI must match exactly. Any typo will cause authentication to fail. Always use https:// — Google requires a secure connection.
Copy Your Credentials
After clicking Create, a popup displays your credentials. Copy both values immediately before clicking OK.
The Client Secret is shown only ONCE. Copy and save BOTH the Client ID and Client Secret before clicking OK. Store them securely in a password manager.
If you lose the Client Secret, you must create a new OAuth client entirely.
| Credential | Format |
|---|---|
| Client ID | xxxxxxxxxx.apps.googleusercontent.com |
| Client Secret | GOCSPX-xxxxxxxxxxxxxxxxxxxxxxxx |
Add Google as OAuth2 Service in Moodle
Navigate to your Moodle OAuth2 services page:
https://cyberpritam.com/admin/tool/oauth2/issuers.phpClick the Google button from the preset services, then paste your credentials:
| Field | Value |
|---|---|
| Client ID | Paste your Client ID from Google Console |
| Client Secret | Paste your Client Secret from Google Console |
| Login page | Ticked (Yes) |
| Service name | Google (leave as default) |
Enable OAuth2 Authentication
Navigate to the authentication management page:
https://cyberpritam.com/admin/settings.php?section=manageauthsConfirm OAuth 2 has the eye icon active (solid blue = enabled).
| Auth Method | Users | Purpose |
|---|---|---|
| Manual accounts | 3 | Admin accounts |
| Email-based self-registration | 3,310 | Existing learners — preserved |
| OAuth 2 (Google) | New users | Global learners — one click |
Enable Self-Registration for Google Users
Navigate to site policies and set self-registration to OAuth2:
https://cyberpritam.com/admin/settings.php?section=sitepoliciesFind the Self registration dropdown and set it to OAuth 2. This allows any Google user to auto-create a Moodle account on their first sign-in.
View the Updated Login Page
Open a new incognito window (Ctrl+Shift+N on Windows, Cmd+Shift+N on Mac) and navigate to:
https://cyberpritam.com/login/index.phpYou should now see the Google Sign-In button alongside the existing login form and guest access option.
Your login page now offers three access methods: Google one-click for new users, username/password for 3,310 existing users, and guest access to browse before purchasing.
Test Google Sign-In
Click the Google button and test with your personal Gmail account. Expected flow:
- Click Google button on cyberpritam.com/login
- Google opens a popup showing available Gmail accounts
- Select your Gmail account
- You are redirected back to cyberpritam.com and logged in automatically
- A new Moodle account is created for this Gmail address
- The learner can immediately browse and enrol in courses
Publish to Production
By default your OAuth app is in Testing mode which restricts it to specific test users. To allow ANY Google user to sign in globally, go to:
Google Console > Google Auth Platform > Audience > Publishing status > Production
The Google Sign-In integration works seamlessly with the AusJournal CCSP badge system. Here is the complete end-to-end learner journey:
| # | Stage | What Happens |
|---|---|---|
| 1 | Discovery | Learner finds cyberpritam.com via Google search or social media |
| 2 | One-click login | Clicks Google button — instant account creation, zero friction |
| 3 | Course enrolment | Pays via Stripe and enrols in CCSP course |
| 4 | Learning | Completes theory modules and practice quizzes |
| 5 | Final assessment | Passes final quiz with score ≥ 70% |
| 6 | Badge issued | AusJournal CCSP badge auto-issued by Moodle |
| 7 | Email notification | Learner receives badge email with LinkedIn Add button |
| 8 | LinkedIn publish | Learner adds CCSP certification to LinkedIn profile in one click |
| 9 | Verification | Employer clicks badge URL — sees AusJournal ISSN credentials |
What You Accomplished
- Created Google Cloud OAuth2 credentials at zero cost
- Configured OAuth consent screen for CyberPritam Learning
- Connected Google OAuth2 to Moodle authentication
- Enabled one-click Google Sign-In on cyberpritam.com
- Preserved all 3,310 existing user accounts without disruption
- Integrated new login system with AusJournal badge workflow
Key URLs Reference
| Resource | URL |
|---|---|
| Google Cloud Console | https://console.cloud.google.com |
| Moodle redirect URI | https://cyberpritam.com/admin/oauth2callback.php |
| Moodle OAuth2 services | https://cyberpritam.com/admin/tool/oauth2/issuers.php |
| Moodle auth management | /admin/settings.php?section=manageauths |
| Site policies | /admin/settings.php?section=sitepolicies |
| Live login page | https://cyberpritam.com/login/index.php |
Troubleshooting
| Issue | Fix |
|---|---|
| Google button not showing | Check OAuth2 is enabled in Manage Authentication |
| Redirect URI mismatch error | Confirm URI in Google Console matches exactly |
| Users cannot auto-register | Set Self registration to OAuth2 in Site policies |
| Lost Client Secret | Create a new OAuth client — the old one cannot be recovered |
| Access restricted to test users | Change Publishing status to Production in Google Console |
In Lab 6 we will build the Splunk micro-skill course — theory content, search query practice, 20-question Aiken quiz, AusJournal Splunk Analyst badge, and global pricing setup.
Lab 5 Complete
Author: Dr. Pritam Shah | SISTMR Australia | AusJournal Editor-in-Chief
ISSN: 2200-1875 (Print) | 2200-1883 (Online) | portal.issn.org