Thanks to visit codestin.com
Credit goes to github.com

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:29
@antn antn requested a review from mthadley September 26, 2025 10:29
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 new authentication provider by consistently updating three interface files. The changes add SalesforceOAuth to the enum of connection types, authentication methods, and identity providers.

  • Added SalesforceOAuth to ConnectionType enum alongside existing SalesforceSAML
  • Added SalesforceOAuth to AuthenticationMethod type union for authentication responses
  • Added SalesforceOAuth to provider unions in both Identity and IdentityResponse interfaces

All additions follow existing patterns and maintain alphabetical ordering. No implementation logic changes were made - this is purely a type-level addition to support the new OAuth provider.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • Score reflects simple type-only changes that follow existing patterns without introducing new logic, security concerns, or breaking changes
  • No files require special attention

Important Files Changed

File Analysis

Filename        Score        Overview
src/sso/interfaces/connection-type.enum.ts 5/5 Added SalesforceOAuth enum value in alphabetical order with existing SAML variant
src/user-management/interfaces/authentication-response.interface.ts 5/5 Added SalesforceOAuth to AuthenticationMethod type union in correct alphabetical order
src/user-management/interfaces/identity.interface.ts 5/5 Added SalesforceOAuth to provider unions in both Identity and IdentityResponse interfaces

Sequence Diagram

sequenceDiagram
    participant Client as Client Application
    participant WorkOS as WorkOS API
    participant SF as Salesforce OAuth
    participant User as End User

    Client->>WorkOS: Initiate authentication with SalesforceOAuth
    WorkOS->>SF: Redirect to Salesforce OAuth endpoint
    SF->>User: Present login form
    User->>SF: Enter credentials
    SF->>SF: Validate credentials
    SF-->>WorkOS: OAuth callback with authorization code
    WorkOS->>SF: Exchange code for access/refresh tokens
    SF-->>WorkOS: Return tokens + user profile
    WorkOS->>WorkOS: Create AuthenticationResponse with SalesforceOAuth method
    WorkOS->>WorkOS: Store Identity with SalesforceOAuth provider
    WorkOS-->>Client: Return authentication response with tokens
Loading

3 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@antn antn merged commit b6023aa into main Sep 30, 2025
5 checks passed
@antn antn deleted the add-salesforce-oauth-provider branch September 30, 2025 20:58
@stacurry stacurry mentioned this pull request Oct 8, 2025
stacurry added a commit that referenced this pull request Oct 10, 2025
## Description
version bump that includes:
- #1361
- #1363
- #1364

## Documentation

Does this require changes to the WorkOS Docs? E.g. the [API
Reference](https://workos.com/docs/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.
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