Skip to content

PRG-02: Auth & URL bundle (from #328 #336 #337 #335 #329)#366

Open
nap-liu wants to merge 5 commits intodataelement:mainfrom
nap-liu:prg/02-auth-url__from-p328-p336-p337-p335-p329
Open

PRG-02: Auth & URL bundle (from #328 #336 #337 #335 #329)#366
nap-liu wants to merge 5 commits intodataelement:mainfrom
nap-liu:prg/02-auth-url__from-p328-p336-p337-p335-p329

Conversation

@nap-liu
Copy link
Copy Markdown

@nap-liu nap-liu commented Apr 10, 2026

This regrouped PR combines the original changes from:\n- #328 fix-unbound-user-login\n- #336 unified-url-resolution\n- #337 generic-oauth2-sso\n- #335 agent-prompt-base-url\n- #329 redis-token-cache\n\nScope: authentication flow, URL normalization, and auth cache behavior.

nap.liu and others added 5 commits April 10, 2026 11:28
… check

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…nant subdomain support

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add a generic OAuth2AuthProvider that works with any OAuth2-compliant
identity provider (Google, Azure AD, Keycloak, Auth0, custom corporate
OAuth2 servers, etc.).

Backend:
- New OAuth2AuthProvider class with configurable authorize_url, token_url,
  userinfo_url, client_id, client_secret, scope, and field_mapping
- Token exchange uses application/x-www-form-urlencoded (RFC 6749)
- Graceful handling of userinfo 401/empty/invalid responses
- Configurable field_mapping maps provider fields to Clawith fields
  (provider_user_id, email, display_name, mobile, avatar_url)
- Standard OIDC field fallbacks when no custom mapping is configured
- Provider registered in auth_registry as "oauth2"
- SSO callback route (GET /auth/oauth2/callback) with session handling
- OAuth2 provider type added to SSO config endpoint

Frontend:
- OAuth2 configuration form with Token URL, UserInfo URL, Scope fields
- Field Mapping section for custom provider field names
- Save/update via dedicated OAuth2 API endpoints

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

1 participant