When you deploy the Salesforce component separately into a dedicated tenant or into your developer team it can not use the OAuth App specifically created for our main elastic.io tenant. For this purposes you must create a different OAuth App and add the required environment variables to the component setup.
Salesforce documentation page gives all specific details and explanation on how to create any app. We will go through the necessary steps to show where to locate those setup options.
To start you need to navigate to the Setup section. Please log-in to your account and select the Setup menu.
Next on the left-side menu use the Quick Find and search for
click to navigate to the page, and press on
New Connected App to start.
It will open a new page which should look like this:
Fill-in the required details for Connected App Name, API Name and Contact Email and also select the check-box called Enable OAuth Settings at API (Enable OAuth Settings) section. After enabling this check-box it will extend into the following setup:
refresh_token. For that purposes you need to explicitly request the
refresh_tokenscope to get one.
refresh_tokento be returned if you are eligible to receive one. This lets the app interact with the user’s data while the user is offline. The
refresh_tokenscope is synonymous with offline_access.
Press save to create your OAuth App.
After creating the OAuth App Salesforce would show you a screen containing all the necessary details of your newly created OAuth App.
From this setup you would need to copy the Consumer Key and the Consumer Secret for use in your custom installation of Salesforce component.
These two keys would need to be defined as Environment Variables for your custom deployed component.
Here is where those two keys fit into the picture. After the deployment, your repository looks like this.
Click You can configure environment variables here link to configure variables for this specific component.
You would need to create two variables here:
OAUTH_CLIENT_ID- your OAuth client key, meaning the Consumer Key.
OAUTH_CLIENT_SECRET- your OAuth client secret, meaning the Consumer Secret.
Note: We renamed the environment variables
SALESFORCE_SECRETto standardize the OAuth workflow.