# Integration with Salesforce

### **Overview**

MangoApps allows integration with Salesforce to provide access to sales opportunities within the CRM module. This integration enhances collaboration by synchronizing opportunity data from Salesforce and displaying it in MangoApps, where users can interact with and manage the data securely and efficiently.

***

### **Required Roles**

To successfully configure the integration:

* **Salesforce Admin Access** is required to create and manage the Connected App.
* **MangoApps Network Admin Access** is required to configure the CRM module and complete the connection on the MangoApps side.
* Any non-admin Salesforce user involved in the setup must have appropriate **API access permissions**.

***

### **Salesforce Side Setup**

Begin by logging in as a **Salesforce admin** and follow these steps to create a Connected App.

<figure><img src="/files/gsJpM1cuHP4b0hxQf39d" alt="" width="563"><figcaption></figcaption></figure>

**Navigate to**: `Apps > App Manager`

<figure><img src="/files/anODvYwiIIRfcyyxY3vw" alt=""><figcaption></figcaption></figure>

Click **New Connected App** and select **Create a Connected App**.

<figure><img src="/files/bKTxZCvb3Q5DXrolBcC5" alt=""><figcaption></figcaption></figure>

Enter:

* **App Name** (API Name auto-generates)
* **Contact Email**
* (Optional) Upload logo images

<figure><img src="/files/uKo4XmZjMBdoaCrmuVXw" alt=""><figcaption></figcaption></figure>

Check both **Enable OAuth Settings** and **Enable for Device Flow**.

The **Callback URL** will auto-generate.

<figure><img src="/files/fqvsqWU1gcbdl2IwUPza" alt=""><figcaption></figcaption></figure>

***

**Assign OAuth Scopes**

<figure><img src="/files/1Q3xMCBO07G4aeYXfITm" alt=""><figcaption></figcaption></figure>

Please include the following scopes:

* Access Headless Passwordless Login API
* Full access
* Manage user data via APIs
* Perform requests at any time

***

**Security Settings**&#x20;

<figure><img src="/files/rt2jXFVfW7a4oxc3LrT3" alt=""><figcaption></figcaption></figure>

Check all following:

* Require PKCE Extension
* Require Secret for Web Server Flow
* Require Secret for Refresh Token Flow
* Enable Client Credentials Flow
* Enable Authorization Code for Credentials Flow
* Enable Token Exchange Flow
* Require Secret for Token Exchange Flow

**Save** the app (it may take up to 10 minutes to take effect) and verify that the information on the details page is correct.

<figure><img src="/files/7wMT4oJKLpBoaXBcyZdd" alt=""><figcaption></figcaption></figure>

***

**Access Consumer Key & Secret**

Go to `Apps > App Manager`

Locate the app and click **Manage Consumer Details**

<figure><img src="/files/Y8774ScuTsR18cBBaQUA" alt=""><figcaption></figcaption></figure>

Complete the authorization step to view and **copy the Key and Secret**.

<figure><img src="/files/V94zZ6ZHcodEhuj6y5JF" alt=""><figcaption></figcaption></figure>

***

Next we will **Authorize User Access** for the new app.

Go to `Apps > Connected Apps > Manage Connected Apps`

<figure><img src="/files/mrZKsJTcplDsgUTVLcf1" alt=""><figcaption></figcaption></figure>

Select the app and **Edit Policies**

* **Permitted Users**: All users may self-authorize
* **IP Relaxation**: Relax IP restrictions
* **Refresh Token Policy**: Refresh token is valid until revoked

<figure><img src="/files/65w8lKhJ2YsmxnJIJ04r" alt=""><figcaption></figcaption></figure>

***

**Enable User Provisioning**

Once user provisioning has been enabled, you will see a new section named **User Accounts**. In this section, click **New User Account** to add users.

<figure><img src="/files/LldP9BBcZw3HvNwWpB3B" alt=""><figcaption></figcaption></figure>

After adding users, the provider side configuration setup is complete.

Before we move on to the MangoApps side of the setup, we will need the user Token ID.&#x20;

To find this **Token ID**, we need to visit the provisioned user's profile.

Click the Settings link from the top right hand profile dropdown menu while logged in as that user.

<figure><img src="/files/VCTKidas7NyRb9Z94sZY" alt=""><figcaption></figcaption></figure>

Go to Profile Settings > **Reset My Security Token**

<figure><img src="/files/lofiTfoilfcwKNfUKpN3" alt=""><figcaption></figcaption></figure>

The **Token** will be emailed to the user.

***

### **MangoApps Side Setup**

In MangoApps, complete the connection by navigating to: `Admin Portal > Modules > CRM`

Ensure the CRM module is enabled and click **Module Settings**

In the **Setup Tab**, select **Salesforce** as the provider from the dropdown menu.

<figure><img src="/files/fra48u72CZrxH66THj9S" alt="" width="563"><figcaption></figcaption></figure>

**Fill in the form with the following details:**

* **Web Services URL**: Enter the URL of your Salesforce organization (e.g., `https://yourdomain.my.salesforce.com`).
* **Username and Password**: Use the credentials of the Salesforce user account that will be used for the integration.
* **Security Token**: Enter the security token generated for this user (received via email after clicking "Reset My Security Token").
* **Consumer Key and Secret**: Paste the key and secret obtained from the Salesforce Connected App setup.

**Enable** the checkbox labeled **“Cache data in MangoApps”** to store synced opportunity data locally for faster access.

Click **Test Connection**. If successful, click **Save Settings**. Opportunities from Salesforce will now auto-populate in MangoApps.

<figure><img src="/files/3iJKaZKUnS6LYfGezCIN" alt="" width="563"><figcaption></figcaption></figure>

For manual sync, use the **Synchronize** button. Make sure to verify synced data under the **All Opportunities** tab

***

### **Testing Considerations**

* Wait 10 minutes after creating the Connected App in Salesforce before testing.
* Use a valid user account with confirmed API permissions and an active security token.
* After saving the MangoApps integration settings, verify data is syncing under **All Opportunities**.
* If sync fails, recheck OAuth scopes, user access permissions, and credentials.

***

### **Security Considerations**

* OAuth Scopes and Secret-based flows ensure secure authentication and access.
* Token exchange and PKCE enforcement protect against token interception.
* Only **authorized users** should have access to manage or view the app in Salesforce.
* MangoApps does not store raw credentials—only encrypted tokens for API access.

***

### **End User Experience**

Once the integration is complete, users can navigate to the **CRM Module > Opportunities** in the MangoApps **User Portal**.

<figure><img src="/files/IX8ocoo0IB0nkJFI591X" alt="" width="563"><figcaption></figcaption></figure>

In the Opportunity detail view:

* A right-hand widget shows key details
* Clicking **“See more details in CRM system”** redirects users to Salesforce

Each user will see opportunities they are assigned to. Admins can assign users in MangoApps to opportunities from the `Admin Portal > CRM > All Opportunities > Members Tab`

<figure><img src="/files/6P9VXYEhbBkSyQHvvNHt" alt="" width="563"><figcaption></figcaption></figure>

***

### **Rollout Recommendations**

* **Pilot Test** with a small group of users and key stakeholders
* Educate CRM users on how to view and navigate synced opportunities
* Confirm all OAuth scopes and tokens are valid and updated before broad rollout
* Monitor the initial sync logs for errors or access issues
* Gradually expand access by assigning users to opportunities via the admin portal


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://guides.mangoapps.com/integrations-guide/workspace/integration-with-salesforce.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
