Add Salesforce OAuth as an authentication provider#475
Merged
Conversation
Contributor
There was a problem hiding this comment.
Greptile Overview
Summary
This PR adds Salesforce OAuth as a supported authentication provider by updating all relevant type definitions and documentation. The changes consistently add "SalesforceOAuth" to enum types across the codebase to enable Salesforce OAuth integration alongside existing providers like Google, Microsoft, Apple, and GitHub.
Key changes:
- Added
SalesforceOAuthto 5 different enum types for comprehensive OAuth support - Updated user management documentation to reflect new provider availability
- Maintains consistency with existing OAuth provider naming patterns (mostly)
Issues found:
- Minor casing inconsistency in
oauth_tokens.pywhere "SalesforceOauth" should be "SalesforceOAuth" to match the established pattern across other files
Confidence Score: 4/5
- This PR is safe to merge with one minor casing fix needed
- Score reflects a straightforward feature addition with minimal risk but requires fixing the casing inconsistency in oauth_tokens.py to maintain consistency
- workos/types/user_management/oauth_tokens.py needs casing fix for SalesforceOauth → SalesforceOAuth
Important Files Changed
File Analysis
| Filename | Score | Overview |
|---|---|---|
| workos/types/sso/connection.py | 5/5 | Added SalesforceOAuth to ConnectionType enum - simple, safe addition with correct naming |
| workos/types/sso/sso_provider_type.py | 5/5 | Added SalesforceOAuth to SsoProviderType enum - consistent with other OAuth providers |
| workos/types/user_management/authentication_response.py | 5/5 | Added SalesforceOAuth to AuthenticationMethod enum - properly positioned and named |
| workos/types/user_management/oauth_tokens.py | 3/5 | Added SalesforceOauth with incorrect casing - should be SalesforceOAuth to match pattern |
| workos/types/user_management/user_management_provider_type.py | 5/5 | Added SalesforceOAuth to UserManagementProviderType enum - correct formatting and placement |
| workos/user_management.py | 5/5 | Updated documentation to include SalesforceOAuth in supported provider list - accurate update |
Sequence Diagram
sequenceDiagram
participant Client as Client Application
participant WorkOS as WorkOS API
participant Salesforce as Salesforce OAuth
Client->>WorkOS: get_authorization_url(provider="SalesforceOAuth")
WorkOS-->>Client: Authorization URL with Salesforce endpoint
Client->>Salesforce: User redirects to Salesforce OAuth
Note over Salesforce: User authenticates with Salesforce credentials
Salesforce-->>Client: Authorization code (via redirect_uri)
Client->>WorkOS: authenticate_with_code(code, session)
WorkOS->>Salesforce: Exchange code for access token
Salesforce-->>WorkOS: OAuth tokens (access_token, refresh_token)
WorkOS-->>Client: AuthenticationResponse with User data
Note over Client,WorkOS: SalesforceOAuth now supported across:<br/>- ConnectionType<br/>- SsoProviderType<br/>- AuthenticationMethod<br/>- UserManagementProviderType<br/>- OAuthTokensProvidersType
6 files reviewed, 1 comment
dandorman
approved these changes
Sep 30, 2025
Contributor
dandorman
left a comment
There was a problem hiding this comment.
not a Python expert, but i think i know a valid addition to a list when i see one
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.
Description
We are rolling out support for Salesforce OAuth. This adds it to the list of providers.
Documentation
Does this require changes to the WorkOS Docs? E.g. the API Reference or code snippets need updates.
If yes, link a related docs PR and add a docs maintainer as a reviewer. Their approval is required.