-
Notifications
You must be signed in to change notification settings - Fork 10
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
OAuth2
support in salesforce
#470
Merged
Merged
Changes from 10 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
612eb92
wip
mtuchi d59bb21
wip: basic auth and oauth
mtuchi 11cde79
remove securityToken from required
mtuchi 4c52ee8
add oauth configuration-schema
mtuchi fda1a7a
improvements
mtuchi c353757
update config path
mtuchi 45b5269
update schema
mtuchi 632b585
add changeset
mtuchi 0d8ae66
improvements
mtuchi 28c93ba
improvements
mtuchi 0c32f9e
salesforce: replace console.error
josephjclark File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@openfn/language-salesforce': minor | ||
--- | ||
|
||
Add `OAuth` support |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,7 +55,6 @@ | |
"required": [ | ||
"loginUrl", | ||
"username", | ||
"password", | ||
"securityToken" | ||
"password" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"$comment": "OAuth2", | ||
"properties": { | ||
"access_token": { | ||
"title": "Access Token", | ||
"type": "string", | ||
"description": "Your Salesforce OAuth2 token", | ||
"writeOnly": true, | ||
"minLength": 1, | ||
"examples": [ | ||
"00DU0000000Krrw!AQgAQG7lgt2Eq9yaOy_sU9e4pSwcoUTm7YGkGWTnltn0dJBkjdNhmOhdRtMMuakaO9GjXToh5b_enUIcjOGm5uU.mFhxR.R4" | ||
] | ||
}, | ||
"other_oparams": { | ||
"type": "object", | ||
"properties": { | ||
"instance_url": { | ||
"type": "string", | ||
"format": "uri", | ||
"title": "Instance URL", | ||
"description": "Your Salesforce instance URL", | ||
"writeOnly": true, | ||
"minLength": 1, | ||
"examples": [ | ||
"https://na1.salesforce.com" | ||
] | ||
} | ||
}, | ||
"required": [ | ||
"instance_url" | ||
] | ||
} | ||
}, | ||
"type": "object", | ||
"additionalProperties": true, | ||
"required": [ | ||
"access_token", | ||
"other_oparams" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@mtuchi , is
securityToken
not required anymore?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.
@taylordowns2000 according to jsforce,
securityToken
is optional - https://jsforce.github.io/document/#username-and-password-loginThere 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.
ah wow. @aleksa-krolls , can you confirm that we don't need users to provide their security token when creating a new Salesforce credential? (is this an admin setting in a client's salesforce system? something like, "require security token for API access"?)
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.
I think most salesforce instance are configured to require
securityToken
but if a client have a salesforce instance that does not requiresecurityToken
then the job should pass.The change i introduced also helps with credential creation on lighting which make the
Security Token
input optional