Commit 86e6c8d
feat(sso): implement organization-level OIDC configuration (#2736)
* feat(sso): implement organization-level OIDC configuration and enforcement
- Add database migration and storage layer for org SSO config and sessions
- Implement OIDC authorization code flow with PKCE in org-sso routes
- Add API endpoints for OIDC flow, config management, and status checks
- Create frontend SSO settings page for org admins with config form
- Add React Query hooks for SSO state management
- Integrate SSO enforcement in shell-layout to block access without valid session
- Add SsoRequiredScreen component to guide users through SSO login
- Update storage types and context factory to include new storage classes
- Update test mocks with new storage fields
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
* fix(sso): fix hooks ordering violation and org membership authorization
Move useOrgSsoStatus above conditional early returns in ShellLayoutContent
to comply with React Rules of Hooks. Replace query-string orgId with
ctx.organization?.id in /status and /authorize endpoints to prevent
unauthorized users from probing SSO config of arbitrary organizations.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix(sso): mount routes after context middleware and fix redirect path
- Move org-sso route mount after meshContext injection middleware to
ensure context is available when handlers execute
- Fix post-SSO redirect to use org root instead of removed org-admin path
- Remove debug logging from SSO enforcement middleware
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix(sso): add SSRF protection for OIDC discovery and token endpoints
Validate all outbound URLs in the OIDC flow against SSRF attacks:
- Enforce HTTPS in production
- Block private/link-local IP ranges (169.254.x.x, 10.x.x.x, etc.)
- Validate discovery document endpoints (token, jwks, authorization)
- Allow HTTP + loopback in development for local OIDC providers
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix(sso): block localhost in SSRF validation for production
Add localhost hostname pattern to privatePatterns so it is blocked
in production. The dev-mode loopback allowance already handles it
for local testing.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>1 parent 286387b commit 86e6c8d
21 files changed
Lines changed: 1560 additions & 1 deletion
File tree
- apps/mesh
- migrations
- src
- api
- routes
- core
- storage
- tools
- connection
- organization
- web
- components
- settings-modal
- pages
- hooks
- layouts
- lib
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| 52 | + | |
52 | 53 | | |
53 | 54 | | |
54 | 55 | | |
| |||
112 | 113 | | |
113 | 114 | | |
114 | 115 | | |
| 116 | + | |
115 | 117 | | |
116 | 118 | | |
117 | 119 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| |||
988 | 989 | | |
989 | 990 | | |
990 | 991 | | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
| 1038 | + | |
991 | 1039 | | |
992 | 1040 | | |
993 | 1041 | | |
| |||
0 commit comments