Repository navigation
Add OAuth refresh token reuse and rotation support - #1668
markmainline wants to merge 2 commits into
Conversation
|
Thanks for the contribution! Before we can merge this, we need @markmainline to sign the Salesforce Inc. Contributor License Agreement. |
|
Additional testing information:
The primary goal of the testing was to validate unattended operation as a migration path away from SOAP login() authentication. In all test cases after the initial OAuth consent flow, authentication was performed using the stored refresh token without requiring further user interaction. |
|
Worth also mentioning, that you will also need to create an entry in Salesforce for an External Client App. Setup -> App -> External Client App. Upload a consumer key/secret, setup the callback URL to: http://localhost:7171/OauthRedirect Salesforce Configuration PrerequisitesTesting was performed using a Salesforce External Client App (ECA). The following Salesforce configuration was required:
The first authentication requires an interactive browser-based OAuth consent flow. During this initial authentication Salesforce issues:
The refresh token is then encrypted and stored in the Data Loader configuration. Subsequent executions authenticate using the stored refresh token and no longer require browser interaction. The implementation was validated using both UI and CLI execution modes and supports refresh token rotation by persisting newly issued refresh tokens returned by Salesforce. This pull request does not remove the existing OAuth/PKCE flow. The browser-based PKCE flow remains the mechanism for obtaining the initial refresh token and acts as a fallback path if refresh token authentication fails. |
CLA has now been signed. The GitHub account associated with this pull request is markmainline and the verified email address is mark.tilley@mainline.uk.com. Please let me know if anything further is required. |
|
The Salesforce CLA has been signed. A subsequent pull request (#1669) opened after signing has automatically received the cla:signed label. It looks as though this PR may simply need the CLA check re-run. |
Summary
This change enables unattended OAuth authentication when using
Salesforce External Client Apps (ECA) and PKCE.
The implementation:
Files Changed
Testing
Completed testing in:
Results
Motivation
This allows Data Loader to operate unattended using modern Salesforce OAuth authentication and provides a migration path away from SOAP login() based authentication.