CIAM Google + Microsoft Sign-In Runbook (Synkronyx)
CIAM Google + Microsoft Sign-In Runbook (Synkronyx)
1. Objective
Enable and validate customer sign-in for ERO using:
- Google federation through Microsoft Entra External ID.
- Microsoft-path sign-in strategy that covers both organizational accounts and consumer Microsoft email use cases.
This runbook is for Inner Loop (local), Test, and Support/Production readiness.
Companion onboarding document for customer intake and one-time setup governance:
docs/43-customer-google-signin-onboarding-and-marketplace-intake.mddocs/44-customer-google-signin-marketplace-questionnaire.mddocs/45-customer-google-signin-post-onboarding-automation-runbook.mddocs/46-customer-google-signin-marketplace-portal-copy.md
2. Ownership Decision: Is pedroneil acceptable?
Short answer:
- Local PoC only: yes, acceptable.
- Shared Dev/Test/Support/Prod: no, move to Synkronyx-owned identity assets.
| Stage | Google Cloud ownership | Acceptable owner | Rationale |
|---|---|---|---|
| Local developer PoC | Personal project | [email protected] | Fast bootstrap and experimentation |
| Shared dev/test | Organization project | Synkronyx admin/service account | Team continuity and auditability |
| Production | Organization project | Synkronyx-controlled only | Security, legal, and recoverability |
Recommended baseline from day one:
- Create a Synkronyx-owned Google Cloud project and OAuth consent/app branding.
- Add at least two Synkronyx admins to prevent lockout.
3. Microsoft Sign-In Strategy (Important)
Microsoft account (live.com) customer sign-in is supported in External ID by configuring Microsoft account as an OpenID Connect identity provider, then attaching it to a user flow.
Use these patterns intentionally:
- MSA customer sign-in (recommended for live.com): Configure Microsoft account (live.com) OIDC and expose it in the user flow.
- Work/school federated sign-in: Add a Microsoft Entra ID tenant as a separate custom OIDC provider.
- Fallback path: Keep local account methods (Email + Password or Email OTP) enabled for operational resilience.
4. Prerequisites
- Synkronyx Entra External ID tenant(s):
sknxerodevfor non-productionsknxeroprodfor support/production
- ERO app registrations aligned with existing taxonomy:
ero-dev,ero-test,ero-supp,ero-prod
- Access roles:
- External Identity Provider Administrator (or equivalent)
- Application Administrator
- Local tooling:
- Azure CLI (
az) - Node.js/NPM
- Optional: Google Cloud SDK (
gcloud) for scripted bootstrap
- Azure CLI (
5. Bootstrap Azure + Entra Context
From repository root:
./join-project.ps1 -Environment dev./scripts/first-run-azure.ps1 -Environment devThen verify your active tenant/subscription context:
az account show --output table6. Bootstrap Google Cloud Project (Synkronyx-first)
Cloud foundation order for Synkronyx:
- Create Google Cloud Identity or Google Workspace for
synkronyx.com. - Verify
synkronyx.comownership in Google Admin. - Create at least two Synkronyx-managed admin accounts.
- Use Synkronyx-managed identities for ownership of projects and OAuth assets.
Minimal manual signup path:
- Open https://cloud.google.com/identity and choose Cloud Identity.
- Select business onboarding with your existing domain.
- Enter
synkronyx.comand complete domain verification with DNS TXT record. - Create primary admin account under
synkronyx.com. - Sign in to Google Admin and confirm domain verification state is active.
If using CLI:
gcloud auth logingcloud projects create sknx-ero-auth-dev --name="SKNX ERO Auth Dev"gcloud config set project sknx-ero-auth-dev6.1 Automated Bootstrap Path (Recommended)
Use the project script to standardize environment loading, Google project setup, redirect URI generation, and optional secret handling.
From repository root:
./scripts/deploy/bootstrap-google-oauth.ps1 -Environment dev -EnsureGoogleApiKeyWhat this script does:
- Loads
settings/.env.local, optionalsettings/.env.nonprod.local, andsettings/.env.<env>.local. - Resolves tenant values from
PUBLIC_SKNX_ERO_TENANT_IDandPUBLIC_SKNX_ERO_TENANT_DOMAIN(or explicit parameters). - Creates/selects Google project (
sknx-ero-auth-<env>by default) and sets active gcloud project. - Enables required Google APIs for bootstrap automation.
- Generates a first-class Google API key when
-EnsureGoogleApiKeyis passed. - Generates the Entra-compatible redirect URI manifest file:
settings/google-redirect-uris-<env>.txt. - Writes baseline metadata keys (
SKNX_ERO_GOOGLE_PROJECT_ID,SKNX_ERO_GOOGLE_API_KEY_SECRET_NAME,SKNX_ERO_GOOGLE_OAUTH_REDIRECT_URI_FILE) intosettings/.env.<env>.local. - Stages secret values in
settings/.env.<env>.localimmediately before Key Vault synchronization. - Stores secret values in Azure Key Vault first by default, then clears local secret values in non-offline mode.
Example with explicit values and Key Vault secret publication:
./scripts/deploy/bootstrap-google-oauth.ps1 \ -Environment dev \ -GoogleProjectId sknx-ero-auth-dev \ -GoogleProjectName "SKNX ERO Auth Dev" \ -EnsureGoogleApiKey \ -GoogleClientId "<google-client-id>" \ -GoogleClientSecret "<google-client-secret>" \ -KeyVaultName "kv-sknx-identity-dev" \ -PersistClientSecretLocallyNotes:
- Google OAuth consent-screen lifecycle and first-time app verification can still require Console actions.
- If you already have a Google project, use
-SkipProjectBootstrapand only generate manifest/env updates. - Use
-OfflineModeonly when Key Vault access is unavailable and temporary local secret fallback is required.
6.2 Configure Synkronyx Entra as Google Workforce IdP
Use this when Synkronyx workforce sign-in to Google must use Entra:
- In Google Admin Console, open Security > Authentication > SSO with third-party IdP.
- In Microsoft Entra, create enterprise application for Google Cloud or custom SAML app.
- Configure SAML identifiers and reply URLs from Google SSO setup page.
- Download Entra federation metadata or certificate and provide it to Google SSO configuration.
- Set sign-in page URL and sign-out URL from Entra SAML endpoints.
- Map NameID to Synkronyx primary email format used in Google accounts.
- Enable SSO first for a pilot organizational unit.
- Validate admin and user sign-in flows before organization-wide rollout.
In Google Cloud Console:
- Open APIs & Services > OAuth consent screen.
- Set user type to External.
- Use Synkronyx branding and Synkronyx support contact email.
- Add required authorized domains (for Entra federation this includes
ciamlogin.comandmicrosoftonline.com).
7. Create Google OAuth Client for Entra Federation
In Google Cloud Console:
- Credentials > Create credentials > OAuth client ID.
- Application type: Web application.
- Add redirect URIs using your Entra external tenant details.
Use Microsoft Learn’s current URI set pattern (replace placeholders):
https://login.microsoftonline.comhttps://login.microsoftonline.com/te/<tenant-ID>/oauth2/authresphttps://login.microsoftonline.com/te/<tenant-subdomain>.onmicrosoft.com/oauth2/authresphttps://<tenant-ID>.ciamlogin.com/<tenant-ID>/federation/oidc/accounts.google.comhttps://<tenant-ID>.ciamlogin.com/<tenant-subdomain>.onmicrosoft.com/federation/oidc/accounts.google.comhttps://<tenant-subdomain>.ciamlogin.com/<tenant-ID>/federation/oauth2https://<tenant-subdomain>.ciamlogin.com/<tenant-subdomain>.onmicrosoft.com/federation/oauth2
Capture:
- Google Client ID
- Google Client Secret
8. Configure Google IdP in Entra External ID
Preferred automated path:
./scripts/deploy/bootstrap-google-oauth.ps1 -Environment dev -SkipProjectBootstrap -EnsureGoogleApiKeyThis updates or creates the tenant-level Google provider in the target CIAM tenant by using Microsoft Graph through Azure CLI authentication. The script intentionally does not modify Microsoft account (MSA) provider configuration.
In Entra admin center (external tenant):
- Entra ID > External Identities > All identity providers.
- Built-in tab > Google > Configure.
- Paste Google Client ID/Secret.
- Save.
9. Configure User Flow
Standard naming convention (recommended):
- Dev:
B2C_1_SUSI_ERO_DEV - Test:
B2C_1_SUSI_ERO_TEST - Prod:
B2C_1_SUSI_ERO_PROD
Keep the SUSI token consistent (Sign Up and Sign In) across all environments.
Optional automated binding for a specific user flow:
./scripts/deploy/bootstrap-google-oauth.ps1 -Environment dev -SkipProjectBootstrap -UserFlows B2C_1_SUSI_ERO_DEV./scripts/deploy/bootstrap-google-oauth.ps1 -Environment test -SkipProjectBootstrap -UserFlows B2C_1_SUSI_ERO_TEST./scripts/deploy/bootstrap-google-oauth.ps1 -Environment prod -SkipProjectBootstrap -UserFlows B2C_1_SUSI_ERO_PRODTo skip flow binding and only configure the tenant-level Google provider:
./scripts/deploy/bootstrap-google-oauth.ps1 -Environment dev -SkipProjectBootstrap -SkipUserFlowBinding- External Identities > User flows > create/select sign-up/sign-in flow.
- Identity providers:
- Enable Google.
- Enable local account method (Email with password or Email OTP).
- Add custom OIDC provider only if required for Microsoft organizational federation.
- Add required user attributes (minimal by default: display name, email).
9.1 Configure MSA (live.com) OIDC Provider
A. Create Microsoft account application
- In an Entra tenant where you can register apps, create a new app registration.
- Supported account types: Accounts in any organizational directory and personal Microsoft accounts.
- Add the redirect URI required by the External ID OIDC setup flow.
- Record the Application (client) ID and Client secret value.
B. Add Microsoft account as OIDC provider in External ID tenant
- In the ERO external tenant, open Entra ID > External Identities > All identity providers.
- On Custom, choose Add new > OpenID Connect.
- Configure with these values: Display name = Microsoft account, Well-known endpoint =
https://login.microsoftonline.com/consumers/v2.0/.well-known/openid-configuration, OpenID Issuer URI =https://login.live.com, Client ID = MSA app Application ID, Client Secret = MSA app secret value, Client authentication =client_secret, Scope =openid profile email, Response type =code. - Save provider.
C. Add MSA provider to the user flow
- Open External Identities > User flows.
- Select the ERO sign-up/sign-in flow.
- Open Identity providers.
- Under Other identity providers, enable the Microsoft account provider.
- Save.
10. Configure ERO App Settings
Set in environment file (settings/.env.dev.local or equivalent):
PUBLIC_SKNX_ERO_CLIENT_IDPUBLIC_SKNX_ERO_TENANT_IDPUBLIC_SKNX_ERO_TENANT_DOMAINPUBLIC_SKNX_ERO_API_SCOPEPUBLIC_SKNX_ERO_AUTH_MOCK
Guidance:
- Local inner loop with live IdP tests: set
PUBLIC_SKNX_ERO_AUTH_MOCK="false". - Mock mode should remain for offline-only development, not federation validation.
11. Test Plan
11.1 Local Inner Loop
-
Start services with
./scripts/bootstrap.ps1 -SkipAzure -SkipTerraform. -
Open
http://localhost:4321. -
Use CIAM panel to sign in.
-
Validate:
- Google login roundtrip succeeds.
- Access token attached to
/api/*calls. /api/datahydrate works.
11.2 Microsoft-path Tests
Run both tracks:
- MSA upstream OIDC sign-in with a real live.com/outlook.com Microsoft account.
- If enabled, separate custom OIDC Entra federation with a work/school account tenant.
- Optional local-account sign-in with Microsoft-hosted email address for fallback-path verification.
Track expected behavior explicitly so teams do not confuse local-account email sign-in with true upstream MSA federation.
11.3 Cloud Outer Loop
- Deploy to dev cloud endpoint.
- Confirm mock token bypass is disabled.
- Verify JWT signature validation and scope enforcement at Worker edge.
12. Promotion Gates (Dev -> Test -> Support -> Prod)
- IdP ownership is Synkronyx-controlled.
- At least two admins per Google OAuth project.
- Redirect URIs match target environment exactly.
- User flow locked and reviewed.
- App registrations and secrets tracked in governed vault/process.
- End-to-end sign-in and token validation evidence captured.
13. Troubleshooting Notes
- If Google sign-in option doesn’t appear: verify Google IdP is enabled in the specific user flow.
- If redirect mismatch errors occur: re-check every configured redirect URI and tenant placeholders.
- If email-claim errors occur on external OIDC providers: confirm claim mapping and, if needed, make email optional at user-flow level per current Entra guidance.
14. References
- Microsoft Entra External ID: Identity providers for external tenants
- Microsoft Entra External ID: Add MSA for customer sign-in
- Microsoft Entra External ID: Add Google as identity provider
- Microsoft Entra External ID: Add custom OIDC provider
- Microsoft Entra External ID: Create sign-up/sign-in user flow
- Google OAuth 2.0 documentation