SSO Runbook — Google Workspace¶
End-to-end setup for sign-in with Google. ~10 minutes from a clean Google Cloud project to a working "Sign in with Google" button on the MFCloud console.
What you'll end up with¶
- A Google Cloud project that owns the OAuth client.
- An OAuth 2.0 client ID + secret you'll paste into MFCloud's Settings → SSO.
- An OAuth consent screen approved internally for your workspace domain.
- (Optional) Group mapping via Google Workspace security groups.
Prerequisites¶
- Workspace Super Admin OR Owner of a Google Cloud project tied to your Workspace organization.
- MFCloud master reachable at a stable HTTPS URL. Google refuses HTTP redirect URIs except for
http://localhost.
Caveat — Google has no end_session_endpoint¶
Google's OIDC discovery doc does not advertise an end-session endpoint, so RP-initiated logout only clears the MFCloud session — the user stays signed into their Google account in the same browser. Click Manage your Google account → Sign out if you need to break the upstream session too. Documented separately on the SSO Callback troubleshooting page.
Step 1 — Create or pick a Google Cloud project¶
- console.cloud.google.com → Project picker → New Project.
- Name =
mfcloud-sso(or whatever you like). - Organization = your workspace org.
- Create.
Step 2 — Enable the OAuth consent screen¶
- APIs & Services → OAuth consent screen.
- User Type = Internal (only users in your workspace can sign in — what you almost certainly want for an admin console). External requires Google verification for production use.
- Create.
- App information:
- App name =
MFCloud Console - User support email = your admin email
- App domain (optional) = your workspace domain
- Authorized domains — add your master's domain (e.g.
example.comformfcloud.example.com). - Developer contact email = your email.
- Save and Continue → Scopes.
- Scopes — click Add or Remove Scopes, tick:
openid.../auth/userinfo.email.../auth/userinfo.profile- Save and Continue through the rest, Back to Dashboard.
Step 3 — Create the OAuth client¶
- APIs & Services → Credentials → + Create Credentials → OAuth client ID.
- Application type = Web application.
- Name =
mfcloud-web(visible only to admins). - Authorized JavaScript origins =
https://<your-mfcloud-host>. - Authorized redirect URIs =
https://<your-mfcloud-host>/api/auth/oidc/callback. - Create.
A modal pops up with two values you'll need:
| Field | Where it goes in MFCloud |
|---|---|
| Your Client ID | Settings → SSO → Client ID |
| Your Client secret | Settings → SSO → Client Secret |
Both are also recoverable later from the Credentials page if you lose the modal — unlike Entra, Google lets you view the secret again.
Step 4 — Paste into MFCloud¶
In the MFCloud console:
- Settings → 🔑 Single Sign-On (OpenID Connect).
- Fill in:
- Issuer URL —
https://accounts.google.com - Client ID — from Step 3.
- Client Secret — from Step 3.
- Sign-in Button Label —
Sign in with Google. - Default Role —
Tenant Viewer(safe default). - Email Claim —
email(Google always populates this). - Groups Claim —
groups(will be empty unless you complete Step 5). - Enable OIDC sign-in ✓.
- Save SSO Settings.
Step 5 — Group claim (optional, requires extra setup)¶
By default Google's ID token does NOT include group memberships. Two options:
Option A — Workspace Cloud Identity Premium groups¶
- Workspace Admin → Apps → LDAP / Cloud Identity → enable group provisioning to your OIDC apps.
- In Google Cloud → IAM → Workforce Identity Federation → add the group claim mapping.
Production-grade but requires Cloud Identity Premium (paid SKU).
Option B — Use the Directory API (recommended for most setups)¶
Skip the group claim entirely. Instead:
- Create a Google Workspace group
[email protected]. - Add members in Google Admin.
- In MFCloud Settings → SSO, leave the group mapping table empty.
- Manually promote those users in MFCloud's IAM tab after their first sign-in.
The trade-off: changes in Google Workspace don't automatically reflect in MFCloud — you'd add+remove people manually. For ≤ 20 admins this is usually fine.
Step 6 — Test it¶
- Sign out of MFCloud.
- Login page should show Sign in with Google.
- Click → google.com picker → pick a workspace-domain account → consent screen (first time only) → back to MFCloud dashboard.
- Open user-avatar menu — should show your email.
Troubleshooting¶
| Symptom | Cause | Fix |
|---|---|---|
Error 400: redirect_uri_mismatch |
Step 3 Authorized redirect URI doesn't match what MFCloud generates | Check master is behind a reverse proxy passing X-Forwarded-Proto: https. Uvicorn needs --proxy-headers. |
Error 403: org_internal |
User isn't in your Workspace org (Step 2 set User Type to Internal) | Either add the user to the org, or change User Type to External + complete Google verification. |
| Sign-in works but no group claim | Step 5 not done | Use Option B or set up Cloud Identity Premium. |
| Logout doesn't end Google session | Google has no end_session_endpoint |
Expected — see "Caveat" at the top of this page. |