-
Notifications
You must be signed in to change notification settings - Fork 465
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
feat(integrations): add support for salesforce cdp #3363
feat(integrations): add support for salesforce cdp #3363
Conversation
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.
Yet another auth flow :/
I wish that instead of TWO_STEP we introduced a MULTI_STEP mode that takes a list of request params because now we have a TWO_STEPS provider which has 3 steps :(
Is it too late to refactor TWO_STEP? @hassan254-prog
|
I stopped trying to anticipate how providers implement authentication. 😆 So many slightly different implementations it is hard to foresee anything. |
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.
Auth is definitely becoming harder. Looks good, some open questions
const parsedCreds = this.parseRawCredentials(responseData, 'TWO_STEP', provider) as TwoStepCredentials; | ||
const stepResponses: any[] = [responseData]; | ||
if (provider.additional_steps) { | ||
for (let stepIndex = 1; stepIndex <= provider.additional_steps.length; stepIndex++) { |
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.
why not simply start at 0?
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.
The loop starts at 1
and accesses provider.additional_steps[stepIndex - 1]
to align with the step numbering convention used in providers.yaml
. Starting from 1
ensures consistency in configuration, making it more intuitive for human readability—e.g., referencing step1
instead of step0
. This approach maintains a natural mapping between the loop index and the defined steps in providers.yaml
.
subject_token_type: urn:ietf:params:oauth:token-type:access_token | ||
token_headers: | ||
content-type: application/x-www-form-urlencoded | ||
token_url: ${step1.instance_url}/services/a360/token |
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.
step1 is what in this context?
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.
step1 refers to the response from the initial request made before any additional steps, if provided. In subsequent steps, parameters are accessed dynamically using step{request_number}
.
Describe the problem and your solution
Add support for Saleforce Data Cloud
Testing instructions (skip if just adding/editing providers)
Here’s a more grammatically polished version:
This provider supports the
TWO_STEP
authentication mode but requires some changes to fully implement it. Specifically, a second request is needed after obtaining the initialaccess_token
from Salesforce to generate the Salesforce Data Cloud (CDP)access_token
. Since I couldn't test this locally with Data Cloud, I created a mock server to simulate responses from both Salesforce and Data Cloud, similar to the approach with Perimeter81. The process of generating the encoded JWT (assertion) is somewhat technical for users, so I also included a script to enable offline generation, as we did with SharePoint Online v1.