Add sandbox option to Salesforce OAuth2 credentials (#1979)

*  Add environment dropdown to OAuth2 creds

*  Add sandbox URL to OAuth2 call

*  Revert options change

*  Set OAuth2 URLs with expressions

*  Extract instance URL from credentials
This commit is contained in:
Iván Ovejero
2021-07-14 18:51:51 +02:00
committed by GitHub
parent e40f0e00a8
commit c5a1bc007f
2 changed files with 21 additions and 6 deletions

View File

@@ -11,19 +11,35 @@ export class SalesforceOAuth2Api implements ICredentialType {
displayName = 'Salesforce OAuth2 API';
documentationUrl = 'salesforce';
properties: INodeProperties[] = [
{
displayName: 'Environment Type',
name: 'environment',
type: 'options',
options: [
{
name: 'Production',
value: 'production',
},
{
name: 'Sandbox',
value: 'sandbox',
},
],
default: 'production',
},
{
displayName: 'Authorization URL',
name: 'authUrl',
type: 'hidden',
default: 'https://login.salesforce.com/services/oauth2/authorize',
required: true,
default: '={{ $self["environment"] === "sandbox" ? "https://test.salesforce.com/services/oauth2/authorize" : "https://login.salesforce.com/services/oauth2/authorize" }}',
},
{
displayName: 'Access Token URL',
name: 'accessTokenUrl',
type: 'string',
default: 'https://yourcompany.salesforce.com/services/oauth2/token',
type: 'hidden',
required: true,
default: '={{ $self["environment"] === "sandbox" ? "https://test.salesforce.com/services/oauth2/token" : "https://login.salesforce.com/services/oauth2/token" }}',
},
{
displayName: 'Scope',