Skip to main content
← Back to list
01Issue
FeatureShippedSwamp Club
Assigneesstack72

Relationships

#1153 SSO + IdP group federation for swamp-club

Opened by stack72 · 7/14/2026· Shipped 7/15/2026

Summary

Enterprise customers need to authenticate via their company IdP (Okta, Entra ID, Keycloak) and have IdP group memberships drive access control in swamp serve. swamp-club is the identity broker — all SSO integration happens here.

Work items

1. Install @better-auth/sso plugin

Add @better-auth/sso to swamp-club and wire it into the existing better-auth setup in lib/auth.ts. Verify it creates the necessary DB collections.

2. Add idpGroups field to user schema

Extend the user model with idpGroups: string[] via additionalFields in lib/auth.ts.

3. Extract and store group claims on SSO login

Configure the SSO plugin's attribute mapping to capture the groups claim from SAML assertions / OIDC tokens. Must update groups on every SSO login, not just first login. May need a [HOST-1] hook if the plugin doesn't auto-persist.

4. Return groups on the userinfo endpoint

Two paths must return groups: string[]:

  • The getAdditionalUserInfoClaim callback in the OIDC provider plugin
  • The session-token fallback path in routes/api/auth/oauth2/userinfo.ts / lib/app/resolve-oauth-userinfo.ts

5. Email domain routing on login page

Update routes/login.tsx to detect the email domain and redirect to the correct SSO provider instead of showing email/password.

6. Admin UI for SSO connections

Page under routes/admin/ to list, add, edit, and remove per-customer SSO configurations (IdP metadata URL, email domain, attribute mapping).

Design doc

Full design at resources/sso-idp-group-federation-design.md in the swamp repo.

Testing

Set up an Okta dev account and verify the full chain: SSO login → groups captured → userinfo returns groups → grants match.

02Bog Flow
OPENTRIAGEDIN PROGRESSSHIPPED+ 1 MOREASSIGNED+ 5 MOREREVIEW+ 3 MOREPR_MERGED+ 1 MORENOTIFICATION_SKIPPED

Shipped

7/15/2026, 4:54:58 PM

Click a lifecycle step above to view its details.

03Sludge Pulse
stack72 assigned stack727/14/2026, 10:18:11 PM

Sign in to post a ripple.