# Creating the xAPI Actions Connected App

xAPI Actions contains a high availability external telemetry service that validates and filters your xAPI statements before delivering them securely to your Salesforce Org in a way that can be digested by your Salesforce Flows.

To enable this flow of xAPI statements, you first need to connect the service to your Salesforce Org. If you have created connected apps before in Salesforce, this should be a familiar process. &#x20;

### App manager

From the Salesforce **Setup** screen, use **Quick Find** to locate “**App Manager**” and open the app:

<figure><img src="https://1749012385-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcTyQ05dv9UTW8n6ypeAM%2Fuploads%2FElFz0i9CULAL6UgMeMU5%2FScreenshot%202024-08-28%20at%2014.26.18.png?alt=media&#x26;token=b04888b7-8fff-425c-8c3d-8530db289bd9" alt="" width="375"><figcaption></figcaption></figure>

On the App Manager page view click “**New Connected App**” in the top right of the screen:

<figure><img src="https://1749012385-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcTyQ05dv9UTW8n6ypeAM%2Fuploads%2FD6reXsNO9IuYzWnyOwcA%2FScreenshot%202024-08-28%20at%2014.26.38.png?alt=media&#x26;token=243fbcd6-907a-41ce-b6c4-976d238371de" alt="" width="375"><figcaption></figcaption></figure>

Complete and configure the form with the following essential details:

* **Connected App Name:** \[Enter a name of your choosing]
* **Contact Email:** \[Your Salesforce account email address for pre-validation]

<figure><img src="https://1749012385-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcTyQ05dv9UTW8n6ypeAM%2Fuploads%2FMOAzb5gi11taD7CrKeRa%2FScreenshot%202024-08-28%20at%2014.31.07.png?alt=media&#x26;token=c59e3f7f-b55b-48a6-a8d7-f890cac29227" alt="" width="375"><figcaption></figcaption></figure>

Configure the required additional settings exactly as described below:

* **Enable 0Auth Settings:&#x20;**<mark style="color:green;">**Enable this setting**</mark>
* **Callback URL:**  Enter `http://localhost`  as a value. \[Note that Client Credentials Flow does not require a callback URL, so we use localhost as a placeholder value for this mandatory field]
* Use the "list builder" tool to **Add Selected 0Auth Scopes.** The **2 required scopes** are:
  * Manage user data via APIs (api)
  * Perform requests at any time (refresh token, offline\_access)

<figure><img src="https://1749012385-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcTyQ05dv9UTW8n6ypeAM%2Fuploads%2FZHsJBPZobk15AI2ugwUa%2FScreenshot%202024-09-02%20at%2012.43.31.png?alt=media&#x26;token=d102dfeb-1472-431f-b5bf-a9d82187001b" alt="" width="375"><figcaption></figcaption></figure>

* **Require Proof Key for Code Exchange (PKCE) Extension for Supported Authorization Flows:** <mark style="color:red;">Disable</mark>
* **Require Secret for Web Server Flow:** <mark style="color:red;">Disable</mark>
* **Require Secret for Refresh Token Flow:** <mark style="color:red;">Disable</mark>
* **Enable Client Credentials Flows:&#x20;**<mark style="color:green;">**Enable this setting**</mark>
  * You will need to confirm this setting: "Anyone with the consumer key and consumer secret can access your org on behalf of the selected user."
* **Enable Authorization Code and Credentials Flow:** <mark style="color:red;">Disable</mark>
* **Enable Token Exchange Flow:** <mark style="color:red;">Disable</mark>
* **Enable Refresh Token Rotation:** <mark style="color:red;">Disable</mark>
* **Issue JSON Web Token (JWT)-based access tokens for named users:** <mark style="color:red;">Disable</mark>
* **Introspect All Tokens:** <mark style="color:red;">Disable</mark>
* **Configure ID Token:** <mark style="color:red;">Disable</mark>
* **Enable Asset Tokens:** <mark style="color:red;">Disable</mark>
* **Enable single logout:** <mark style="color:red;">Disable</mark>

<figure><img src="https://1749012385-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcTyQ05dv9UTW8n6ypeAM%2Fuploads%2F7kNFeH6KSDQ2tA6Juz9q%2FScreenshot%202024-08-28%20at%2014.33.18.png?alt=media&#x26;token=6a55689c-1ab1-4952-91a9-01b0095ecdd2" alt="" width="375"><figcaption><p>All required values</p></figcaption></figure>

**Save** this configuration, you will need to confirm to continue.

Note that changes can take up to **10 minutes** to take effect.

Upon completion you will be redirected to the page you just created.

### Connected app

Now select **Manage** from the App Manager:

<figure><img src="https://1749012385-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcTyQ05dv9UTW8n6ypeAM%2Fuploads%2FhhvyO1FTgOYQrZHqUVXQ%2FScreenshot%202024-08-28%20at%2014.37.07.png?alt=media&#x26;token=11d6b322-60fc-4e59-b94f-6779c7d644af" alt="" width="375"><figcaption></figcaption></figure>

Select the **Edit Policies** button to configure the following options exactly as described below:

<figure><img src="https://1749012385-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcTyQ05dv9UTW8n6ypeAM%2Fuploads%2FvbUeLEDw9Sl9IIyDKpPZ%2FScreenshot%202024-08-28%20at%2014.37.27.png?alt=media&#x26;token=1c318f6c-4ec9-4917-be7a-45bc4c99ab2a" alt="" width="375"><figcaption></figcaption></figure>

The **Policy setup** required settings are as follows:

<figure><img src="https://1749012385-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcTyQ05dv9UTW8n6ypeAM%2Fuploads%2FqV63dNNxdEEtFMsE5Iyu%2FScreenshot%202024-08-28%20at%2014.38.44.png?alt=media&#x26;token=d95c26c7-526d-41e5-8892-0063d7a9f3d4" alt="" width="375"><figcaption><p>All required values</p></figcaption></figure>

* **Permitted Users:** Select "Admin approved users are pre-authorized"
  * You will need to confirm this setting: "Enabling this option will result in all users currently using this app being denied access. Please reference the Connected Apps OAuth Usage Report if you are unsure who is using the app."
  * Note that you need to apply this setting in order to **Manage Profile** as described below.
* **IP Relaxation:** Select "Relax IP Restrictions"
* Under **Client Credentials Flow**, select the "**Run as"** field and enter your User ID.&#x20;

Press **Save**, which will take you back to the **Manage App** screen. \[**Support note:** It has been noted that occasionally the Salesforce screen will error on save, even after required fields have been populated. Simply clicking **Save** again usually resolves this.]&#x20;

### Manage app

Now select the **Manage Profiles** button to configure the following options. \[**Troubleshooting note:** Note that you will only see this button/option if you have successfully completed the **Permitted User** setting as described above]:

<figure><img src="https://1749012385-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcTyQ05dv9UTW8n6ypeAM%2Fuploads%2Fs6p3ecYgnNav8MgDVeM0%2FScreenshot%202024-08-28%20at%2014.43.16.png?alt=media&#x26;token=4a644d91-2f4f-4204-bb9a-95dad100255e" alt="" width="375"><figcaption></figcaption></figure>

Select the user profile(s) that have access to this app, for example “System Administrator”:

<figure><img src="https://1749012385-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcTyQ05dv9UTW8n6ypeAM%2Fuploads%2FDYV9Ojq0YpwlInknGSnN%2FScreenshot%202024-08-28%20at%2014.43.33.png?alt=media&#x26;token=adc7c063-e497-4f67-96b7-28192eacdd6e" alt="" width="375"><figcaption></figcaption></figure>

**Save** the setting.

Allow about **10 minutes** for Salesforce to configure your setup.

### Consumer details

Now go back to your **App Manager / App Listing** and select to "**View"** your connected app using the right-side function button:

<figure><img src="https://1749012385-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcTyQ05dv9UTW8n6ypeAM%2Fuploads%2Fs4MRHBsOSJ3Oy8ddPumG%2FScreenshot%202024-08-28%20at%2014.45.53.png?alt=media&#x26;token=ef4855ea-2fd0-4216-bf4f-51eba72dfa93" alt="" width="375"><figcaption></figcaption></figure>

<figure><img src="https://1749012385-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcTyQ05dv9UTW8n6ypeAM%2Fuploads%2FzfqU0hFcGxyZRKJyc8ys%2FScreenshot%202024-08-28%20at%2014.46.18.png?alt=media&#x26;token=7f30d218-5db6-4820-980d-24f56271b3f2" alt="" width="184"><figcaption></figcaption></figure>

Select the **Manage Consumer Details** button:

<figure><img src="https://1749012385-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcTyQ05dv9UTW8n6ypeAM%2Fuploads%2F1kvqK4Lmh3iuGj6x5E2T%2FScreenshot%202024-08-28%20at%2014.46.34.png?alt=media&#x26;token=dc02fc8c-75bf-4622-b2b1-b98a3d7edfaa" alt="" width="375"><figcaption></figcaption></figure>

You will need to **re-authenticate your Salesforce access** at this point:

<figure><img src="https://1749012385-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcTyQ05dv9UTW8n6ypeAM%2Fuploads%2Fopebjanxhrc2LbtHvXUT%2FScreenshot%202024-08-28%20at%2014.47.22.png?alt=media&#x26;token=7b7cbd7c-4a18-48db-adb7-513119dac9cc" alt="" width="375"><figcaption></figcaption></figure>

Once authenticated, your **consumer key** and **secret** will be generated:

<figure><img src="https://1749012385-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcTyQ05dv9UTW8n6ypeAM%2Fuploads%2F9QUUX4TM6tv2ikGEwpeq%2FScreenshot%202024-08-28%20at%2014.47.53.png?alt=media&#x26;token=06a70a9c-10a6-469e-8f8a-48dba0984da3" alt="" width="375"><figcaption></figcaption></figure>

Don't close this browser tab as you will need to **copy** and **paste** these 2 values to continue with the [**xAPI Actions** setup](https://documentation.globebyte.com/reasoning-ai/actions-for-learning/setting-up-xapi-actions)
