Skip to content

Google sso role mapping fix#1712

Merged
Eugeny merged 8 commits intowarp-tech:mainfrom
SteezyCougar:google-sso-role-mapping-fix
Mar 19, 2026
Merged

Google sso role mapping fix#1712
Eugeny merged 8 commits intowarp-tech:mainfrom
SteezyCougar:google-sso-role-mapping-fix

Conversation

@SteezyCougar
Copy link
Copy Markdown
Contributor

@SteezyCougar SteezyCougar commented Feb 7, 2026

Summary

TLDR is that auto-role provisioning doesn't work with google oauth out the box since google doesn't natively expose groups. That means we have to use a google service account to do a lookup on the user to see what groups they are part of.

  • Fetch Google Workspace group memberships via Directory API on SSO login (Google doesn't expose groups through
    OIDC)
  • Map groups to roles in config, with support for multiple roles per group: "[email protected]": ["role1", "role2"]
  • Add default_credential_policy on SSO providers to control auth requirements for auto-created users
  • Change missing role during SSO sync from hard error to warning

Setup

Requires a GCP service account with domain-wide delegation and admin.directory.group.readonly scope. New optional
fields on the Google provider: service_account_email, service_account_key, admin_email, role_mappings.

Backward compatibility

All new fields are optional. Existing configs work unchanged. RoleMapping uses #[serde(untagged)] so both "group":
"role" and "group": ["role1", "role2"] work.

Config example

sso_providers:
- name: google
auto_create_users: true
default_credential_policy:
http: ["sso"]
ssh: ["web"]
mysql: []
postgres: ["web"]
provider:
type: google
client_id: "..."
client_secret: "..."
service_account_email: "$GOOGLE_SA_EMAIL"
service_account_key: "$GOOGLE_SA_KEY"
admin_email: "[email protected]"
role_mappings:
"[email protected]": "engineering"
"[email protected]": ["warpgate:admin", "engineering"]

@SteezyCougar
Copy link
Copy Markdown
Contributor Author

@Eugeny I think this one is ready! We're running it internally now and it seems to be working!

@Eugeny
Copy link
Copy Markdown
Member

Eugeny commented Feb 18, 2026

Sorry for the delay - I'll be able to test this in a week or so

@Christian-Little-Tava
Copy link
Copy Markdown

Any luck @Eugeny ?
Also as always feel free to modify/change as you see fit

@SteezyCougar SteezyCougar force-pushed the google-sso-role-mapping-fix branch from 6629574 to 7c01b09 Compare March 11, 2026 03:31
@SteezyCougar
Copy link
Copy Markdown
Contributor Author

Rebased!

@Eugeny Eugeny merged commit 1a5056e into warp-tech:main Mar 19, 2026
15 checks passed
SteezyCougar added a commit to SteezyCougar/warpgate that referenced this pull request Mar 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants