Configure Google Workspace Group Claims
This guide explains how to configure Google Workspace to include group membership in SAML assertions. These group claims enable automatic team assignment in AI Gateway based on users' Google Workspace group memberships.
Overview
When users authenticate via SSO, AI Gateway reads their group memberships from the SAML assertion. To enable this:
- Create groups in Google Workspace Admin Console
- Configure your SAML app to include group membership in assertions
- Map the Google group email addresses to AI Gateway teams
Prerequisites
- Google Workspace Admin Console access with super administrator permissions
- SAML application configured for AI Gateway SSO
- Groups created in Google Workspace for team mapping
Step 1: Create Groups in Google Workspace
Navigate to Groups
- Sign in to the Google Admin Console
- Go to Directory → Groups
- Click Create group
Configure Group Settings
- Enter a Group name (e.g., "Engineering", "Sales", "Design")
- Enter a Group email (e.g.,
engineering@yourdomain.com) - Add a Description (optional)
- Click Next
Set Access Settings
- Choose an Access type (Public, Team, or Restricted)
- Configure who can join the group
- Click Create group
Add Members to Groups
- Click on the group name to open it
- Click Members → Add members
- Enter email addresses of users to add
- Click Add
Step 2: Configure SAML App Group Membership
Navigate to Your SAML App
- In Google Admin Console, go to Apps → Web and mobile apps
- Click on your AI Gateway SAML application
- Click SAML attribute mapping or navigate to the attribute mapping section
Configure Group Membership
-
Scroll down to the Group membership (optional) section
-
You'll see the message: "Group membership information can be sent in the SAML response if the user belongs to any of the groups you add here."
-
Click on Search for a group dropdown
-
Select the groups you want to include:
- Select each group that should be sent in the SAML response
- Only users who are members of these groups will have that membership included
-
Verify the App attribute field is set to
Groups -
Click Save
Only select groups that are relevant for team-based access control. Users will only receive group claims for groups they are actually members of.
Step 3: Configure Group Attribute in AI Gateway
After configuring Google Workspace, you need to tell AI Gateway which attribute contains group information.
Update SSO Settings
- Access your tenant configuration in the SSO management system
- Navigate to SSO Mapping → Group Attribute Mapping
- Enter
Groupsin the attribute name field (matching the App attribute from Step 2) - Click Save
Verify Configuration
After saving, the AI Gateway portal should show:
- Group Attribute Mapping:
Groups(instead of "Not configured")
Step 4: Configure AI Gateway Teams
Create teams in AI Gateway using the Google group email addresses:
- In AI Gateway portal, navigate to Access → Teams
- Click Create Team
- Enter a team name and description
- In SSO Groups, enter the Google group email address (e.g.,
engineering@yourdomain.com) - Press Enter to add the group
- Click Create
Example Team Mappings
| AI Gateway Team | SSO Group (Google Group Email) |
|---|---|
| Engineering | engineering@yourdomain.com |
| Sales | sales@yourdomain.com |
| Design | design@yourdomain.com |
| Product | product@yourdomain.com |
Troubleshooting
Groups Not Appearing for Users
Issue: Users don't see team-restricted resources after logging in
Solutions:
- Verify the user is a member of the Google group
- Check that the group is selected in the SAML app's group membership section
- Have the user log out and log back in (group membership is evaluated at login)
- Verify the group email matches exactly in the AI Gateway team SSO mapping
Group Attribute Not Configured
Issue: AI Gateway shows "Group Attribute Mapping: Not configured"
Solutions:
- Ensure you entered
Groupsin the Group Attribute Mapping field in SSO settings - Verify the SAML app has the App attribute set to
Groups - Save the configuration and refresh the page
Wrong Group Format
Issue: AI Gateway team matching fails even with correct group
Solutions:
- Use the full group email address (e.g.,
engineering@yourdomain.com) - Check for case sensitivity - group emails are typically lowercase
- Verify there are no extra spaces in the SSO Group mapping
User in Multiple Groups
Issue: User should have access to multiple teams' resources
Expected behavior: Users who are members of multiple Google groups will automatically be assigned to all corresponding AI Gateway teams and have access to all their resources.
Security Considerations
- Principle of least privilege: Only include groups in SAML assertions that are needed for access control
- Group management: Control group membership carefully as it directly affects resource access
- Regular audits: Review group memberships and team mappings periodically
- Naming conventions: Use consistent, descriptive group names and emails
Next Steps
After configuring group claims:
- Create Teams in AI Gateway using your Google group email addresses
- Assign MCP Servers and Personas to teams
- Test with a non-admin user to verify access control works correctly