- Newest
- Most votes
- Most comments
Hi there,
From the documentation follow the steps to create Secrets Manager with clientId and clientSecret and encrypt it using KMS Key, which has permission attached to be accessed by AppFlow. (You can skip this step, if it is already configured)
There are two methods to create connector profile in Salesforce.
Method 1: With authCode
{
"connectorProfileName": "<connector name>",
"connectorType": "Salesforce",
"connectionMode": "Public",
"connectorProfileConfig": {
"connectorProfileProperties": {
"Salesforce": {
"instanceUrl": "InstanceURL",
"isSandboxEnvironment": true
}
},
"connectorProfileCredentials": {
"Salesforce": {
"clientCredentialsArn": "arn:aws:secretsmanager:{Region}:{Account-Id}:secret:{SecretKey}",
"oAuthRequest": {
"authCode": "<AuthCode>",
"redirectUri": "<RedirectUri>"
}
}
}
}
}
Method 2: Without AuthCode
{
"connectorProfileName": "<connector name>",
"connectorType": "Salesforce",
"connectionMode": "Public",
"connectorProfileConfig": {
"connectorProfileProperties": {
"Salesforce": {
"instanceUrl": "InstanceURL",
"isSandboxEnvironment": true
}
},
"connectorProfileCredentials": {
"Salesforce": {
"accessToken": "<AccessToken>",
"refreshToken": "<RefreshToken>"
}
}
}
}
How to generate authCode ?
Auth code can be generated using URL: https://<DOMAIN>/services/oauth2/authorize?response_type=code&client_id=<CONSUMER_KEY>&redirect_uri=<Redirect_Url>
NOTE:
- <DOMAIN_URL> and <CONSUMER_KEY> can be viewed in Salesforce "My Domain" and "Manage Connected Apps" respectively.
- redirect_uri = Callback URL configured in your Salesforce Connected App
Generated authCode can be used in creating connector profile using Method 1
How to generate AccessToken and RefreshToken ?
Once you get AuthCode from previous step, accessToken and refreshToken can be generated using below method:
$ curl --location --request POST 'https://login.salesforce.com/services/oauth2/token?code=<authcode>&grant_type=authorization_code&client_id=<CONSUMER_KEY>&client_secret=<CONSUMER_SECRET>&redirect_uri=<redirectURI>'
Sample Output:
{ "access_token": "XXXXX", "refresh_token": "XXXXX", "signature": "XXXXX", "scope": "refresh_token SOMETHING", "id_token": "XXXXX", "instance_url": "InstanceURL", "id": "https://login.salesforce.com/id/XXXXX/XXXXX ", "token_type": "Bearer", "issued_at": "XXXXX" }
access_token and refresh_token can be used in creating connector profile using Method 2
Relevant content
- asked 2 years ago
- asked 2 years ago
- asked 3 years ago
