Integrate WorkOS SSO for Open Web UI#2
Open
vdimarco wants to merge 1 commit into
Open
Conversation
- Add WorkOS environment variables to .env.example - Add persistent configs and provider registration for WorkOS in backend config - Integrate WorkOS SDK client in OAuthManager for login and callback - Implement WorkOS-specific login and callback handling with user mapping and session management - Add extensive tests for WorkOS configuration, login flow, profile mapping, and email domain validation - Update pyproject.toml to include workos SDK dependency - Add WorkOS login button to frontend authentication page This enables enterprise SSO via WorkOS using SAML, OIDC, or OAuth providers, extending existing OAuth capabilities with WorkOS SDK support. Co-authored-by: terragon-labs[bot] <terragon-labs[bot]@users.noreply.github.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
| ) | ||
| raise HTTPException(400, detail=ERROR_MESSAGES.INVALID_CRED) | ||
|
|
||
| provider_sub = f"workos@{sub}" |
There was a problem hiding this comment.
Missing profile ID validation in WorkOS callback
The WorkOS callback extracts profile.id at line 1500 without validating it's not None or empty, then uses it at line 1517 to build provider_sub. The standard OAuth callback validates that sub is present (lines 1218-1220) before using it. If profile.id is unexpectedly None or empty, this could create users with oauth_sub values like "workos@None" or "workos@", potentially causing multiple users to share the same identifier and leading to account confusion or unauthorized access.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Changes
Backend
Frontend
Dependencies
UI Integration
Testing
Notes
🌿 Generated by Terry
ℹ️ Tag @terragon-labs to ask questions and address PR feedback
📎 Task: https://www.terragonlabs.com/task/8499bebf-e7ee-452a-9872-bf7b5e27d933
Note
Enables enterprise SSO via WorkOS with a dedicated SDK-driven flow, config persistence, and UI entry point.
WORKOS_*configs inconfig.py; registersworkosprovider (flaggeduses_workos_sdk) and excludes it from OpenID logout warningsutils/oauth.py): InitializesWorkOSClient; new_handle_workos_loginand_handle_workos_callbackpaths usingorganization_id/connection_id, domain/org validation, user creation/merge, role/group updates, JWT andoauth_sessioncookie handlingtest_workos_oauth.pycovering config presence, provider loading, SDK availability flag, login precondition, profile mapping, domain checks, and auth URL generationsrc/routes/auth/+page.svelteshows a WorkOS SSO button that routes to/oauth/workos/login.env.exampledocs forWORKOS_*; addworkos>=5.0.0topyproject.tomlWritten by Cursor Bugbot for commit 9f9c9bf. This will update automatically on new commits. Configure here.