|
| 1 | +--- |
| 2 | +title: Access denied for this user error when accessing Salesforce with server-to-server flow |
| 3 | +description: Resolves an error that occurs due to invalid permissions of the connected app in Salesforce. |
| 4 | +ms.date: 05/12/2025 |
| 5 | +author: sbmjais |
| 6 | +ms.author: shjais |
| 7 | +ms.custom: sap:CRM Permissions and Configurations\CRM Settings |
| 8 | +--- |
| 9 | + |
| 10 | +# "Access denied for this user" error when accessing Salesforce with server-to-server flow |
| 11 | + |
| 12 | +This article helps you troubleshoot and resolve the "Access denied for this user" error when you access Salesforce with server-to-server flow. |
| 13 | + |
| 14 | +## Who is affected? |
| 15 | + |
| 16 | +| Requirement type |Description | |
| 17 | +|---------|---------| |
| 18 | +|**Client app** | Copilot for Sales Outlook add-in | |
| 19 | +|**Platform** | Web and desktop clients | |
| 20 | +|**OS** | Windows and Mac | |
| 21 | +|**Deployment** | User managed and admin managed | |
| 22 | +|**CRM** | Salesforce | |
| 23 | +|**Users** | All users | |
| 24 | + |
| 25 | +## Symptoms |
| 26 | + |
| 27 | +When a user tries to access Salesforce with server-to-server flow, the following error message is displayed. |
| 28 | + |
| 29 | +> Access denied for this user. |
| 30 | +
|
| 31 | +The related error message reads "User doesn't have admin permission to access the connected app." |
| 32 | + |
| 33 | +## Cause |
| 34 | + |
| 35 | +During Salesforce server-to-server flow setup, a connected app is deployed to the Salesforce organization. The connected app is associated with an integration user. An access token is retrieved with the credentials of the connected app. The error occurs when the integration user is not approved to access the connected app. |
| 36 | + |
| 37 | +## Resolution |
| 38 | + |
| 39 | +To resolve this issue, you must fix the connected app configuration in Salesforce. |
| 40 | + |
| 41 | +1. Sign in to Salesforce CRM as an administrator. |
| 42 | +1. Go to **Setup** > **Platform Tools** > **Apps** > **Connected Apps** > **Managed Connected Apps**. |
| 43 | +1. On the **Connected Apps** page, select **Copilot for Sales Connected App**. |
| 44 | +1. Under **Custom Connected App Handler**, ensure that the value of **Run As** is set to **Copilot for Sales Integration User**. |
| 45 | +1. Go to **Administration** > **Users** > **Users** and confirm that the profile of the integration user is **CopilotForSalesIntegrationProfile**. |
| 46 | + |
| 47 | +Also, check is there were unintended changes made to the connected app configuration. If yes, revert the changes to the original configuration. |
| 48 | + |
| 49 | +## More information |
| 50 | + |
| 51 | +If your issue is still unresolved, go to the [Copilot for Sales - Microsoft Community Hub](https://techcommunity.microsoft.com/t5/viva-sales/bd-p/VivaSales) to engage with our experts. |
| 52 | + |
| 53 | +[!INCLUDE [Third-party disclaimer](../../includes/third-party-disclaimer.md)] |
0 commit comments