Salesforce Authentication action
- Updated: 2023/11/16
Salesforce Authentication action
Salesforce Authentication is the first command action that you need to call to get authenticated with Salesforce.
Note: The examples and graphics provided on this page are for
representation purposes only and may not accurately reflect your specific instance. We do not
assume responsibility for their maintenance or
accuracy.
Authenticate access to Salesforce by getting the authentication
parameters from the Salesforce connected app and using them in Automation 360.Note: Recently, Salesforce implemented the following: OAuth 2.0
Username-Password Flow Blocked by Default in New Orgs. Ensure you
allow these flows in your Salesforce environment to use the
Salesforce package. See OAuth and OpenID Connect Settings.
You
can use different connection methods to connect to Salesforce:
- OAuth2 - Client Credentials: Use this connection method by providing the Salesforce account credentials. You need a Salesforce username and password to establish a connection.
- Control room OAuth connection: Use this connection method by creating an OAuth connection and storing it in the Control Room.
Procedure
- Log in to the Control Room.
- Create a new bot or modify an existing bot. For more details, see Create your first bot.
- From the Actions pane, select Start of the bot flow. and place it under the
- In the Authentication Type field, select the authentication method from the drop down.
-
To view client ID and client secret details for OAuth2 - Client
Credentials authentication, complete the following steps:
-
To connect using OAuth2 - Client Credentials, complete the following steps:
-
To configure a Control room OAuth connection in Salesforce,
complete the following steps:
- To connect using Control room OAuth connection, pick a Salesforce OAuth connection you have created and stored in the Control Room. For more details, see Configure OAuth connections in Control Room.
- Enter the API version. You can find the API version in your Salesforce Enterprise Edition setup. For more details, see Find Salesforce API version.
- Enter Default as the Session name.
-
Create either a Multiple or
Dictionary variable to store the response. You can do
one of the following:
- The authentication command returns a dictionary with 2 key-value pairs.
Authorization
(credential type) andInstanceUrl
(String type). TheAuthorization
is hidden, but you will be able to read theInstanceUrl
. For example, you can use a message box to print of the value of ,$str_Authresponse{InstanceUrl}$
, this returns the Salesforce URL. - You can select Multiple variable as shown below and map to a credential
variable and a string variable as keys.
Authorization returns a token, which is hidden as it is a credential type, this token can be passed directly in the Rest Web Services command.
- The authentication command returns a dictionary with 2 key-value pairs.
- Click Run to save and run your bot. Once authenticated, you will be able to use the token to call other Salesforce API services.