Liquidity Docs

SSO Setup (`seed-sso.py` + Google Cloud)

Getting Google SSO working is two parts: (1) a Google OAuth client in Google

Getting Google SSO working is two parts: (1) a Google OAuth client in Google Cloud Console, and (2) running scripts/seed-sso.py to wire that client into Liquid IAM as the domain-gated Google provider on the single-SSO application.

1. Google Cloud Console (external)

In Google Cloud Console -> your project -> OAuth:

  • Configure the OAuth consent screen (Internal, if the org is the Google Workspace satschel.com, so only org users can consent).
  • Create an OAuth 2.0 Client ID of type Web application.
  • Authorized JavaScript origins = the IAM origin(s):
    • http://localhost:8000 (local)
    • https://iam.example.com (hosted)
  • Authorized redirect URIs = the IAM callback (IAM's, not the app's):
    • http://localhost:8000/callback
    • https://iam.example.com/callback
  • Copy the Client ID and Client secret for the seed script (env only, never committed).

The redirect URI points at IAM's /callback because Google returns to IAM; IAM then returns to the relying app's /callback.

2. scripts/seed-sso.py

Idempotent script that authenticates as admin, creates/updates the Google provider with a domain-restricted emailRegex, and configures the target application for single-SSO (Google only, password login off, only Logo + Providers shown on the login page). It retries on SQLITE_BUSY.

Environment variables

VarPurposeDefault
IAM_URLIAM base URLhttp://localhost:8000
IAM_ADMIN_USER / IAM_ADMIN_PASSadmin loginadmin / 123
IAM_ADMIN_ORG / IAM_ADMIN_APPadmin realm/app for loginbuilt-in / app-built-in
GOOGLE_CLIENT_IDfrom Google Cloud Console(required)
GOOGLE_CLIENT_SECRETfrom Google Cloud Console(required)
ALLOWED_DOMAINemail domain to gatesatschel.com
APP_ORGorganizationliquidity
APP_NAMEapplication to configuretransfer-agent
PROVIDER_NAMEprovider namegoogle-<domain-prefix> (e.g. google-satschel)
IAM_LOGOlogin logo URL{IAM_URL}/liquidity-logo.svg

Run

export IAM_URL=http://localhost:8000
export GOOGLE_CLIENT_ID=xxxxx.apps.googleusercontent.com
export GOOGLE_CLIENT_SECRET=xxxxx
export ALLOWED_DOMAIN=satschel.com
export APP_ORG=liquidity
export APP_NAME=transfer-agent
python3 scripts/seed-sso.py

What it configures

  • Provider admin/google-satschel: type=Google, scopes profile email, emailRegex = ^[a-zA-Z0-9._%+-]+@satschel\.com$.
  • Application transfer-agent (org liquidity): enablePassword=false, enableSignUp=true (JIT), Google provider linked (canSignUp/canSignIn), only Logo + Providers visible on the login page, Liquidity CSS/footer applied.

3. Relying-party redirect URIs (in the IAM app)

For each app that logs in through IAM, its redirectUris must include every console origin's /callback, and its post-logout URIs must include each origin root. For the Transfer Agent console, that means entries like:

  • http://localhost:5173/callback and http://localhost:5173
  • https://app.example.com/callback and https://app.example.com

These are set on the Application (admin console or via the seed/admin API).

Checklist summary

  • Google OAuth client created; JS origins + redirect URIs include the IAM origin/callback
  • GOOGLE_CLIENT_ID / GOOGLE_CLIENT_SECRET provided to seed-sso.py via env
  • seed-sso.py run against the target IAM
  • App redirectUris include the relying app's /callback (+ post-logout roots)
  • Admin password changed for any shared instance