# Vault: Salesforce ECA (Local) Connection Setup Steps

### Pre-req: get your Callback URL (redirect URI) <a href="#id-1-pre-req-get-your-callback-url-redirect-uri" id="id-1-pre-req-get-your-callback-url-redirect-uri"></a>

For AutoRABIT’s Vault ECA setup, you need **the callback URL**

Callback URL is depending on the instance:

```
{$isntancename}/dashboard/setup/addSfOrg
```

Example:

```
https://vault-qa.autorabit.com/dashboard/setup/addSfOrg
```

{% stepper %}
{% step %}

### Create the External Client App (ECA) in your Salesforce Org

1. Login into Salesforce

<figure><img src="https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2FuEgVe6WmjpCb34dVyVnZ%2Fimage.png?alt=media&#x26;token=5f656167-d748-4034-9848-4d910a363a4a" alt=""><figcaption></figcaption></figure>

2. In **Salesforce**, go to **Setup**.
3. In **Quick Find**, search **External Client Apps**.
4. Open **External Client App Manager** (or the External Client Apps area).

<figure><img src="https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2F4qLQvHkFr9IFeN01MR2T%2Fcdn.webp?alt=media&#x26;token=fddc17b2-a254-456f-84c3-7deb4879ca65" alt=""><figcaption></figcaption></figure>

5. Click **New External Client App**.
6. Fill in the basics:

* **Name / Label ( e.g. AR\_Local)**
* **API Name** (auto-filled)
* **Contact Email**
* **Distribution State**:
  * **Local** (only for this org)

<figure><img src="https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2FcPf8TEerBcMcr6wLQysL%2Ff306f55b-5110-4872-bbec-20b722c50b29.png?alt=media&#x26;token=d4e0a10d-2eb1-4d31-ad07-7c29adca2ad8" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### &#x20;Enable OAuth + set callback URL + scopes <a href="#arm-3-enableoauthsetcallbackurlscopes" id="arm-3-enableoauthsetcallbackurlscopes"></a>

1. Click **Enable OAuth** (or expand **API (Enable OAuth Settings)** and check **Enable OAuth**).
2. Set \**Callback URL*

   The URL you collected in step 1.
3. Choose **OAuth Scopes**:
   1. Access the Identity URL service (id, profile, email, address, phone)
   2. Manage user data via APIs
   3. Manage user data via web browsers (web)
   4. Full access (full)
   5. Perform requests at any time (refresh\_token, offline\_access.

<figure><img src="https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2FdvjiuQ12PpeH76lgpQKr%2F87d2dfba-10dd-4045-919b-555c15d1092f.png?alt=media&#x26;token=5673a5b7-630a-4d98-a635-ebf906017a75" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Turnment <a href="#arm-4-turnment" id="arm-4-turnment"></a>

1. In **Flow Enablement**, select **Enable Authorization Code and Credentials Flow**.
2. **user credentials are required in the POST body** (Salesforce shows this option when you choose that flow) should be disabled.

<figure><img src="https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2FQggg8ZOFmdgfTYvxkl1A%2F619e40a3-3cab-4c4d-a1ff-a2580e7ba452.png?alt=media&#x26;token=f570a082-0af5-4a2a-9524-95c9b2c1d333" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Security toggles (common defaults) <a href="#arm-5-securitytoggles-commondefaults" id="arm-5-securitytoggles-commondefaults"></a>

In the **Security** section the next options should be enabled:

* **Require secret for Web Server Flow**
* **Require secret for Refresh Token Flow**
  {% endstep %}

{% step %}

### &#x20;Create the app and capture Client ID / Secret <a href="#arm-6-createtheappandcaptureclientid-secret" id="arm-6-createtheappandcaptureclientid-secret"></a>

1. Click **Create**.
2. Open the app’s **Settings** tab and locate **Consumer Key and Secret**:

* **Consumer Key** = **Client ID**
* **Consumer Secret** = **Client Secret**

<figure><img src="https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2FvdrLVYWkWVY9HKEZTM7G%2F37254284-9b62-4fd6-940f-df5576eb0718.png?alt=media&#x26;token=e0f11e99-cf13-4e6b-9486-cf1f176fc40e" alt=""><figcaption></figcaption></figure>

When you click the button for Consumer Key and Secret a code will be sent to the registered email for the user creating the configuration

<figure><img src="https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2FqIxOH726Z1wOSIxa3Tt2%2Fb5d12e36-9af7-4655-998e-b1cbbd0aa7b6.png?alt=media&#x26;token=59c6862a-c7ec-4321-bfb1-1d06feb1c0b1" alt=""><figcaption></figcaption></figure>

After getting the code and verify in Salesforce the Consumer Key (CliendID) and Consumer Secret (Client Secret) will be displayed.

**IMPORTANT: STORE THIS VALUES IN A SAFE PLACE WHERE CAN BE EASILY USED FOR FUTURE REFERECES.**

<figure><img src="https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2FdE4gGKjy8VhdI85RqHaS%2Fd6f4ece7-0cd4-4ae3-8c8f-bb1322d472dd.png?alt=media&#x26;token=08c11311-4f10-4021-b70c-ce8d082652b1" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Configure Policies (very important) <a href="#arm-7-configurepolicies-veryimportant" id="arm-7-configurepolicies-veryimportant"></a>

After creating the ECA, open the **Policies** tab and adjust as needed (exact options vary by org/security posture), commonly:

* **Permitted Users**: often set to **Admin approved users are pre-authorized** for controlled rollouts.
* Add the required **profiles/permission sets** (or approved users) for who is allowed to authorize.
  {% endstep %}

{% step %}

### What you’ll use in AutoRABIT <a href="#arm-8-whatyoulluseinautorabit" id="arm-8-whatyoulluseinautorabit"></a>

Once created, the set of values you’ll reference in your Vault configuration are:

* **Client ID**
* **Client Secret**

Also, the internal direction is to be clear that **one ECA per customer org** can be used across products (rather than creating one per AR product).

***

After the configuration in Salesforce is complete, and you have obtained the ClientID and Client Secret, we can go to Vault to create the connection

In the menu Click Salesforce Org Integration

<figure><img src="https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2FgYumrRUsGt9N5xUkmygq%2F8245333d-b8d7-49db-a774-c1c712a8cb2e.png?alt=media&#x26;token=58694d23-1d6c-4ec3-bcf8-8626c9318fc3" alt=""><figcaption></figcaption></figure>

Create the connections filling the required information.

<figure><img src="https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2Foq8FV3n4VTyRrgLxsAd7%2F6d6574e8-2412-4b5b-bd33-edd0b762d4ef.png?alt=media&#x26;token=f4fe1eb0-1d66-4a80-aaba-965dacd44dd6" alt=""><figcaption></figcaption></figure>

Enter the Client Id and Client Secret that you received from Salesforce

<figure><img src="https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2FmMhN2UZ1kbAsA34B7V9c%2F4afab8d3-c577-4432-951e-2f02e69ffb42.png?alt=media&#x26;token=99cdf8cc-f64b-474f-a189-ab5df391335f" alt=""><figcaption></figcaption></figure>

Once the continue button is clicked, a Salesforce login is shown for the user we intend to use with the connection.

<figure><img src="https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2FUJa2o71MkufAsZO2Mpjk%2F2ee0edd6-fd45-4ca0-9114-356995ca5351.png?alt=media&#x26;token=6cf963d9-8318-4b99-9977-3333bea3a003" alt=""><figcaption></figcaption></figure>

A message from Salesforce will show to require granted permissions for the user to use the scopes defined in the ECA, Click Allow

<figure><img src="https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2Fc4VDWxfmyZIEacA0hPrH%2Fe6cc1945-e43c-4c68-802b-873dacaa0b2f.png?alt=media&#x26;token=72420979-a4c6-4104-bfe4-4ad88d6c5386" alt=""><figcaption></figcaption></figure>

Then you will be returned and the connection will be saved.

<figure><img src="https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2FPI2Vs6Ef9ZC9C0tv5ZRJ%2F841c3e49-3380-470a-b4f6-c19ee797a362.png?alt=media&#x26;token=c6d8d76c-4aa9-451d-a6fa-1c57652799b8" alt=""><figcaption></figcaption></figure>

Click finish and the success message will appear

<figure><img src="https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2F5VYSG1aMyhUy3CnCzB01%2F5caba430-fb77-494d-a717-1958d333d168.png?alt=media&#x26;token=53c11731-46c7-4024-830f-8a5996d6c4c1" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
**Important:** This setup is **Salesforce org-specific**. You must repeat this process **for each customer Salesforce org** you want to connect, since the External Client App is created inside (and scoped to) that org and produces org-specific credentials.
{% endhint %}
{% endstep %}
{% endstepper %}
