Skip to content

Conversation

@antn
Copy link
Member

@antn antn commented Sep 26, 2025

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.

[ ] Yes

If yes, link a related docs PR and add a docs maintainer as a reviewer. Their approval is required.

@antn antn self-assigned this Sep 26, 2025
@antn antn requested a review from a team as a code owner September 26, 2025 10:46
@antn antn requested a review from csrbarber September 26, 2025 10:46
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 SalesforceOAuth to 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.py where "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
Loading

6 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Copy link
Contributor

@dandorman dandorman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not a Python expert, but i think i know a valid addition to a list when i see one

@antn antn merged commit e2a2a05 into main Sep 30, 2025
6 checks passed
@antn antn deleted the add-salesforce-oauth branch September 30, 2025 20:58
@stanleyphu stanleyphu mentioned this pull request Oct 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants