-
Notifications
You must be signed in to change notification settings - Fork 3k
fix(salesforce): updated to more flexible oauth that allows production, developer, and custom domain salesforce orgs (#2441) #2444
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…eading to duplicate oauth records (#2441) * fix(oauth): updated oauth providers that had unstable reference IDs leading to duplicate oauth records * ack PR comments
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Greptile SummaryThis PR modernizes Salesforce OAuth to support Production, Sandbox (Developer Edition), and Custom Domain (My Domain) organizations through a flexible multi-endpoint authentication flow. Key Changes:
Previous Thread Resolutions:
Unrelated Change: Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant Browser
participant AuthRoute as Salesforce Authorize
participant SF as Salesforce
participant Callback as Callback Handler
participant DB
User->>Browser: Click Connect Salesforce
Browser->>AuthRoute: Request without orgType
AuthRoute->>Browser: HTML form with org options
Browser->>User: Show form
User->>Browser: Select Production/Sandbox/Custom
Browser->>AuthRoute: Request with orgType
AuthRoute->>AuthRoute: Validate custom domain
AuthRoute->>AuthRoute: Generate PKCE
AuthRoute->>Browser: Set secure cookies
Browser->>SF: OAuth authorization
SF->>User: Login prompt
User->>SF: Authenticate
SF->>Callback: Return auth code
Callback->>Callback: Verify state and PKCE
Callback->>SF: Exchange code for token
SF->>Callback: Access token and instanceUrl
Callback->>Callback: Build metadata JSON
Callback->>DB: Save or update account
Callback->>Browser: Redirect to app
Note over DB: Token Refresh Later
DB->>SF: Refresh with authBaseUrl
alt Primary endpoint works
SF->>DB: New token
else Try production fallback
SF->>DB: New token
else Try sandbox fallback
SF->>DB: New token
end
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
10 files reviewed, 5 comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
11 files reviewed, 3 comments
Summary
Type of Change
Testing
Tested manually
Checklist