Skip to content

Commit 7ed9596

Browse files
authored
Merge pull request #7949 from MicrosoftDocs/main
Auto push to live 2024-12-30 02:00:02
2 parents 720324b + 19f5e6e commit 7ed9596

7 files changed

Lines changed: 147 additions & 33 deletions

File tree

104 KB
Loading
185 KB
Loading
63.9 KB
Loading
Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
---
2+
title: Troubleshoot Authorization_RequestDenied error with Microsoft Graph
3+
description: Guides to troubleshoot Authorization_RequestDenied error with Microsoft Graph in Postman.
4+
ms.author: anukala
5+
ms.date: 12/24/2024
6+
ms.service: entra-id
7+
ms.custom: sap:Microsoft Graph Users, Groups, and Entra APIs
8+
---
9+
10+
# Troubleshoot Authorization_RequestDenied error with Microsoft Graph
11+
12+
When you use Microsoft Graph API to manage users, you might receive the following error message:
13+
14+
> `Authorization_RequestDenied. Insufficient privileges to complete the operation.`
15+
16+
This article demonstrates how to troubleshoot the `Authorization_RequestDenied` error in Microsoft Graph API by using Postman, through a "disable user" scenario.
17+
18+
## Cause of the Authorization_RequestDenied error
19+
20+
This error typically occurs because the user or app doesn't have sufficient permissions. To call Graph APIs, your app registration must have the following permissions:
21+
22+
- The appropriate Microsoft Entra RBAC role for the required access level. For more information, see [Microsoft Entra built-in roles](/entra/identity/role-based-access-control/permissions-reference).
23+
- The necessary API permissions to access Microsoft Graph.
24+
25+
26+
## Troubleshooting Microsoft Graph API by using Postman
27+
28+
29+
### Step 1: Assign Microsoft Entra RBAC role to the app registration (Service Principal)
30+
31+
1. Log in to the [Azure portal](https://portal.azure.com), and go to **Microsoft Entra ID**.
32+
1. In the **Manage** section, select **Roles and administrators**.
33+
1. Select the appropriate role based on the required level of access. In this article, the app will manage the users. Therefore, **User Administrator** is selected.
34+
1. Select **Add assignments**, select your app registration, and then select **Add**.
35+
36+
### Step 2: Locate the application ID, client secret, and token endpoints of your app
37+
38+
1. In the [Azure portal](https://portal.azure.com), go to **App registrations**, and then select your app registration.
39+
1. On the **Overview** page, record the **Application (client) ID**.
40+
1. Select **Endpoints**. This selection provides information, such as token endpoints, that will be used in the Postman configuration. This article uses OAuth 2.0 and token-based authentication together with Entra ID. In this case, you should record the **OAuth 2.0 token endpoint (v2)**.
41+
42+
:::image type="content" source="media/troubleshoot-authorization-requestdenied-graph-api/check-endpoints.png" alt-text="Screenshot that shows checking the endpoints of the app registration." lightbox="media/troubleshoot-authorization-requestdenied-graph-api/check-endpoints.png":::
43+
1. In the **Manage** section, select **Certificates & secrets**. Create a client secret or use an existing client secret for testing.
44+
45+
In the Postman configuration, ensure you use the Client secret value, not the Secret ID. The client secret value cannot be viewed, except immediately after it's created.
46+
47+
### Step 3: Configure Postman
48+
49+
1. In Postman, select a request or collection, and then select **Authorization**.
50+
1. Set Auth type to **OAuth 2.0**.
51+
1. In the **Configure New Token** section, specify the following configuration:
52+
53+
- Grant type: Client Credentials
54+
- Access Token URL: \<OAuth 2.0 token endpoint\>.
55+
- Client ID: \<Application (client) ID\>
56+
- Client secret: \<Client secret value\>
57+
- Scope: `https://graph.microsoft.com/.default`
58+
- Client Authentication: Send as Basic Auth header
59+
60+
:::image type="content" source="media/troubleshoot-authorization-requestdenied-graph-api/postman-config.png" alt-text="Screenshot of Postman configurations." lightbox="media/troubleshoot-authorization-requestdenied-graph-api/postman-config.png":::
61+
62+
1. Select **Get New Access Token**. If the configuration is correct, you should receive a token that will be used to run the Microsoft Graph API call.
63+
1. Select **Proceed**, and then select **Use token**.
64+
65+
### Step 4: Test and troubleshoot the Microsoft Graph API
66+
67+
1. Send the following PATCH request to disable a user. `1f953789-0000-0000-0000-6f21508fd4e2` is the object ID of a user in the Entra ID.
68+
69+
``` HTTP
70+
Patch https://graph.microsoft.com/v1.0/users/1f953789-0000-0000-0000-6f21508fd4e2
71+
```
72+
73+
```JSON
74+
{
75+
"accountEnabled": false
76+
}
77+
```
78+
79+
1. The `Authorization_RequestDenied` error message is received in the response:
80+
81+
```Output
82+
{
83+
"error": {
84+
"code": "Authorization_RequestDenied",
85+
"message": "Insufficient privileges to complete the operation.",
86+
"innerError": {
87+
"date": "2024-12-24T03:25:32",
88+
"request-id": "096361b2-75be-479b-b421-078610030949",
89+
"client-request-id": "096361b2-75be-479b-b421-078610030949"
90+
}
91+
}
92+
}
93+
```
94+
95+
1. Check the [Update user scenario in Microsoft Graph REST API v1.0 endpoint reference](/graph/api/user-update?view=graph-rest-1.0&tabs=http#permissions&preserve-view=true). The following permission is required to enable and disable a user, as described in the Microsoft Graph REST API v1.0 endpoint reference.
96+
97+
| Property | Type | Description |
98+
|:----------------|:--------|:------------|
99+
| accountEnabled | Boolean | `true` if the account is enabled; otherwise, `false`. This property is required when a user is created. <br/> - *User.EnableDisableAccount.All* + *User.Read.All* is the least privileged combination of permissions required to update this property. <br/> - In delegated scenarios, *Privileged Authentication Administrator* is the least privileged role that's allowed to update this property for all administrators in the tenant. |
100+
101+
1. Check whether the app registration has the required permissions:
102+
1. Locate your app registration in the Azure portal.
103+
2. In the **Manage** section, select **API permissions**
104+
3. Check the configured API permissions. In this case, the app registration doesn't have the **User.EnableDisableAccount.All** permission that is the root cause of the issue.
105+
106+
:::image type="content" source="media/troubleshoot-authorization-requestdenied-graph-api/check-api-permissions.png" alt-text="Screenshot that shows checking API permissions." lightbox="media/troubleshoot-authorization-requestdenied-graph-api/check-api-permissions.png":::
107+
108+
1. Select **Add a permission** to add **User.EnableDisableAccount.All** to the app registration.
109+
1. You must also select **Grant admin consent for default directory** for the permissions. Select **Yes** to confirm that you want to grant admin consent.
110+
1. Send the PATCH request to disable a user. If the request is successful, you should receive a `204 No Content` response.
111+
112+
[!INCLUDE [third-party-disclaimer](../../../includes/third-party-disclaimer.md)]

support/entra/entra-id/toc.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,10 @@
230230
href: mfa/unexpected-error-reset-pwd.md
231231
- name: Verify account error when resetting password
232232
href: mfa/cannot-verify-account-reset-pwd.md
233-
233+
- name: Microsoft Graph Users, Groups, and Entra APIs
234+
items:
235+
- name: Troubleshoot Authorization_RequestDenied error
236+
href: app-integration/troubleshoot-authorization-requestdenied-graph-api.md
234237
- name: Microsoft Entra User Provisioning and Synchronization
235238
items:
236239
- name: User Sign-in or password Problems

support/power-platform/dataverse/email-exchange-synchronization/http-server-returned-forbidden-exception.md

Lines changed: 29 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2,94 +2,93 @@
22
title: Http server returned Forbidden exception
33
description: Provides a solution to an error that occurs when you select the Test & Enable Mailbox button on a mailbox record in Dynamics 365.
44
ms.reviewer:
5-
ms.topic: troubleshooting
6-
ms.date: 11/19/2024
5+
ms.date: 12/30/2024
76
ms.custom: sap:Email and Exchange Synchronization
87
---
9-
# "Http server returned Forbidden exception" error appears in Microsoft Dynamics 365 mailbox
8+
# "Http server returned Forbidden exception" error when testing a Dynamics 365 mailbox
109

11-
This article provides a solution to an error that occurs when you select the **Test & Enable Mailbox** button on a mailbox record in Dynamics 365.
10+
This article provides a solution to an error that occurs when you select the **Test & Enable Mailbox** button on a mailbox record in Microsoft Dynamics 365.
1211

1312
_Applies to:_ &nbsp; Microsoft Dynamics 365
1413
_Original KB number:_ &nbsp; 4483440
1514

1615
## Symptoms
1716

18-
When you select the **Test & Enable Mailbox** button on a mailbox record in Dynamics 365, the test results section shows Failure and the following alert is logged:
17+
When you select the **Test & Enable Mailbox** button on a mailbox record in Dynamics 365, the test results section shows **Failure** and the following alert is logged:
1918

20-
> "The email message "Your mailbox is now connected to Dynamics 365" cannot be sent because an error occurred while establishing a secure connection to the email server. Mailbox [Mailbox Name] didn't synchronize. The owner of the email server profile Microsoft Exchange Online has been notified.
21-
Email Server Error Code: Http server returned Forbidden exception."
19+
> The email message "Your mailbox is now connected to Dynamics 365" cannot be sent because an error occurred while establishing a secure connection to the email server. Mailbox [Mailbox Name] didn't synchronize. The owner of the email server profile Microsoft Exchange Online has been notified.
20+
> **Email Server Error Code**: Http server returned Forbidden exception.
2221
23-
If you select **Details**, the following other details are shown:
22+
If you select **Details**, the following details are shown:
2423

25-
> "Error : System.Net.WebException: The request failed with HTTP status 403: Forbidden.
26-
at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
27-
at System.Web.Services.Protocols.SoapHttpClientProtocol.EndInvoke(IAsyncResult asyncResult)
28-
at Microsoft.Crm.Asynchronous.EmailConnector.ExchangeServiceBinding.EndCreateItem(IAsyncResult asyncResult)
29-
at Microsoft.Crm.Asynchronous.EmailConnector.ExchangeOutgoingEmailProvider.EndCreateItem()"
24+
> Error : System.Net.WebException: The request failed with HTTP status 403: Forbidden.
25+
> at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
26+
> at System.Web.Services.Protocols.SoapHttpClientProtocol.EndInvoke(IAsyncResult asyncResult)
27+
> at Microsoft.Crm.Asynchronous.EmailConnector.ExchangeServiceBinding.EndCreateItem(IAsyncResult asyncResult)
28+
> at Microsoft.Crm.Asynchronous.EmailConnector.ExchangeOutgoingEmailProvider.EndCreateItem()
3029
3130
## Cause
3231

33-
Dynamics 365 communicates with Microsoft Exchange using Exchange Web Services (EWS) requests. If EWS is disabled, this error will occur. The following contents are some potential ways that EWS may be disabled or restricted in Exchange:
32+
Dynamics 365 communicates with Microsoft Exchange using Exchange Web Services (EWS) requests. If EWS is disabled, this error occurs. Here are some potential ways that EWS might be disabled or restricted in Exchange:
3433

35-
1. EWS is disabled for the mailbox
36-
2. EWS is disabled for the entire organization
37-
3. The `EwsApplicationAccessPolicy` is set to **EnforceAllowList** and `the EwsAllowList` doesn't allow access from Dynamics 365 (CRM).
38-
4. The `EwsApplicationAccessPolicy` is set to **EnforceBlockList** and `the EwsBlockList` includes Dynamics 365 (CRM).
34+
1. EWS is disabled for the mailbox.
35+
2. EWS is disabled for the entire organization.
36+
3. The `EwsApplicationAccessPolicy` is set to **EnforceAllowList** and the `EwsAllowList` doesn't allow access from Dynamics 365.
37+
4. The `EwsApplicationAccessPolicy` is set to **EnforceBlockList** and the `EwsBlockList` includes Dynamics 365.
3938

4039
## Resolution
4140

42-
**If the issue only occurs for some mailboxes, check if EWS is disabled for the mailbox:**
41+
### Check if EWS is disabled for the mailbox if the issue only occurs for some mailboxes
4342

44-
1. First check to see if EWS has been disabled for the mailbox. Use the following PowerShell command:
43+
1. First, check if EWS is disabled for a specific mailbox using this PowerShell command:
4544

4645
```powershell
4746
Get-CASMailbox <mailbox-alias> | ft EwsEnabled
4847
```
4948
50-
2. If **EwsEnabled** is set to **False**, use the following PowerShell command to enable Exchange Web Services (EWS) for the mailbox:
49+
2. If **EwsEnabled** is set to **False**, enable it using this command:
5150
5251
```powershell
5352
Set-CASMailbox <mailbox-alias> -EwsEnabled $True
5453
```
5554
5655
> [!IMPORTANT]
57-
> After running this command, it may take up to 120 minutes before the setting change takes effect.
56+
> After running this command, it might take up to 120 minutes before the setting change takes effect.
5857
59-
**If the issue occurs for all mailboxes, check if EWS is disabled at the organization level, or if the EwsAllowList is being used to limit what EWS traffic is allowed.**
58+
## Check if EWS is disabled at the organization level or if the EwsAllowList limits the EWS traffic
6059
61-
1. Use the following PowerShell command to see if any of the EWS settings are configured:
60+
1. Use this PowerShell command to check organization-level settings:
6261
6362
```powershell
6463
Get-OrganizationConfig |ft Name, EwsEnabled,EwsApplicationAccessPolicy,EwsBlockList,EwsAllowList
6564
```
6665
67-
2. Verify that **EwsEnabled** isn't set to **False**. The following command can be used to set **EwsEnabled** to **True** if it's currently set to **False**:
66+
2. Ensure that `EwsEnabled` isn't set to **False**. If it is, enable it using:
6867
6968
```powershell
7069
Set-OrganizationConfig -EwsEnabled $True
7170
```
7271
7372
> [!IMPORTANT]
74-
> After running this command, it may take up to 120 minutes before the setting change takes effect.
73+
> After running this command, it might take up to 120 minutes before the setting change takes effect.
7574
76-
3. If `EwsApplicationAccessPolicy` is set to **EnforceAllowList** and the `EwsAllowList` doesn't contain a value for CRM (Example: CRM/\*), which would prevent Dynamics 365 (CRM) from being able to communicate with Exchange. Use the following command to update the list to include CRM/* and whatever other applications you want to allow (\<PreviousAllowList> in the following example):
75+
3. If `EwsApplicationAccessPolicy` is set to **EnforceAllowList**, check if the `EwsAllowList` contains a value for CRM (for example, CRM/\*) to allow Dynamics 365 (CRM) to communicate with Exchange. If it does not, use the following command to update the list to include CRM/* and any other applications you want to allow. In this example \<PreviousAllowedList> is the list of applications that were previously in the allowlist:
7776
7877
```powershell
7978
Set-OrganizationConfig -EwsApplicationAccessPolicy:EnforceAllowList -EwsAllowList:CRM/*,<PreviousAllowedList>
8079
```
8180
8281
> [!IMPORTANT]
83-
> After running this command, it may take up to 120 minutes before the setting change takes effect.
82+
> After running this command, it might take up to 120 minutes before the setting change takes effect.
8483
85-
4. If `EwsApplicationAccessPolicy` is set to **EnforceBlockList** and the **EwsAllowList** contains a value for CRM (Example: CRM/*), which would prevent Dynamics 365 (CRM) from being able to communicate with Exchange. Use the following command to update the list to no longer include CRM:
84+
4. If `EwsApplicationAccessPolicy` is set to **EnforceBlockList**, check if the `EwsBlockList` contains a value for CRM (for example, CRM/*), which prevents Dynamics 365 (CRM) from communicating with Exchange. If it does, use the following command to update the list to no longer include CRM. In this example \<PreviousBlockList WITH CRM REMOVED> is the list of applications that were previously in the blocklist except for CRM:
8685
8786
```powershell
8887
Set-OrganizationConfig -EwsApplicationAccessPolicy:EnforceBlockList -EwsBlockList:<PreviousBlockList WITH CRM REMOVED>
8988
```
9089
9190
> [!IMPORTANT]
92-
> After running this command, it may take up to 120 minutes before the setting change takes effect.
91+
> After running this command, it might take up to 120 minutes before the setting change takes effect.
9392
9493
## More information
9594

support/windows-server/windows-security/sids-not-resolve-into-friendly-names.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ searchScope:
1414
---
1515
# Some SIDs don't resolve into friendly names
1616

17-
This article provides some information about the issue where some security identifiers (SIDS) don't resolve into friendly names.
17+
This article provides some information about the issue where some security identifiers (SIDs) don't resolve into friendly names.
1818

1919
_Original KB number:_ &nbsp; 4502539
2020

@@ -43,7 +43,7 @@ Windows 10, version 1809 uses more than 300 Capability SIDs.
4343
## More information
4444

4545
> [!Important]
46-
> Don't delete Capability SIDS from either the registry or file system permissions. Removing a Capability SID from file system permissions or registry permissions might cause a feature or application to function incorrectly. After you remove a Capability SID, you cannot use the UI to add it back.
46+
> Don't delete Capability SIDs from either the registry or file system permissions. Removing a Capability SID from file system permissions or registry permissions might cause a feature or application to function incorrectly. After you remove a Capability SID, you cannot use the UI to add it back.
4747
4848
When you're troubleshooting an unresolved SID, make sure that it isn't a Capability SID. To get a list of all of the Capability SIDs, follow these steps:
4949

0 commit comments

Comments
 (0)