You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# HTTP 403 authorization error when calling the Microsoft Graph Security API
10
10
11
-
This article provides soltions to an HTTP 403 error that occurs when you call the Microsoft Graph Security API.
11
+
This article provides solutions to an HTTP 403 error that occurs when you call the Microsoft Graph Security API.
12
12
13
13
## Symptoms
14
14
15
-
When using the Microsoft Graph Security API to call endpoints such as `https://graph.microsoft.com/v1.0/security/alert` and `https://graph.microsoft.com/beta/security/secoreScores`, you might get an 403 error with the following message:
15
+
When using the Microsoft Graph Security API to call endpoints such as `https://graph.microsoft.com/v1.0/security/alert` and `https://graph.microsoft.com/beta/security/secoreScores`, you might receive a 403 error with the following message:
16
16
17
17
> Auth token does not contain valid permissions or user does not have valid roles
18
18
19
19
## Cause
20
20
21
21
The error occurs due to one of the following reasons:
22
22
23
-
- The access token lacks the necessary Microsoft Graph permission for the security endpoints.
24
-
- The authenticating user that obtains the access token isn't in a required Azure AD admin role for delegated permission type token.
23
+
- The access token lacks the necessary Microsoft Graph permissions for the security endpoints.
24
+
- The authenticating user that obtains the access token doesn't have a Microsoft Entra admin role required for the delegated permission type token.
25
25
26
-
## Solution 1: Use valid Microsoft Graph permission
26
+
## Solution 1: Use valid Microsoft Graph permissions
27
27
28
-
There are two types of tokens: application and delegated permission token. For more information, see [Application and delegated permissions for access tokens in the Microsoft identity platform](../app-integration/application-delegated-permission-access-tokens-identity-platform.md).
28
+
There are two types of tokens: application and delegated permission tokens. For more information, see [Application and delegated permissions for access tokens in the Microsoft identity platform](../app-integration/application-delegated-permission-access-tokens-identity-platform.md).
29
29
30
-
For delegated permission token, Microsoft Graph permission is in the `scp` claim. For application permission token, the permission is in the `roles` claim. To get the required Microsoft Graph permissoin, you can refer to the following table that listed in [Authorization and the Microsoft Graph Security API](/graph/security-authorization#register-an-application-with-the-microsoft-identity-platform-endpoint):
30
+
For delegated permission tokens, the Microsoft Graph permissions are in the `scp` claim. For application permission tokens, the permissions are in the `roles` claim. To get the required Microsoft Graph permissions, you can refer to the following table, which is also listed in [Authorization and the Microsoft Graph Security API](/graph/security-authorization#register-an-application-with-the-microsoft-identity-platform-endpoint):
31
31
32
32
|Permission | Entity | Supported requests |
33
33
|:----------|:-------|:-------------------|
@@ -41,7 +41,7 @@ For more information, see [Use the Microsoft Graph security API](/graph/api/reso
41
41
42
42
## Solution 2: Use valid Microsoft Entra admin roles
43
43
44
-
For delegated permission token, the authenticating user needs to be in one of the following admin roles:
44
+
For delegated permission tokens, the authenticating user needs to have one of the following admin roles:
45
45
46
46
|Microsoft Entra role|Role template ID|
47
47
|---|---|
@@ -51,7 +51,7 @@ For delegated permission token, the authenticating user needs to be in one of th
51
51
52
52
For more information, see [Microsoft Entra built-in roles](/entra/identity/role-based-access-control/permissions-reference) and [Authorization and the Microsoft Graph Security API](/graph/security-authorization).
53
53
54
-
The `wids` claim in the token contains the Microsoft Entra role. It can be used to determine if the user has the sufficient privilege.
54
+
The `wids` claim in the token contains the Microsoft Entra role. It can be used to determine whether the user has sufficient privileges.
55
55
56
56
```json
57
57
"ver": "1.0"
@@ -65,6 +65,6 @@ The `wids` claim in the token contains the Microsoft Entra role. It can be used
65
65
```
66
66
67
67
> [!NOTE]
68
-
> If the token is obtained via the [implicit grant flow](/entra/identity-platform/v2-oauth2-implicit-grant-flow), the `wids` claim might not exist. For more information, see [Access tokens in the Microsoft identity platform](/entra/identity-platform/access-tokens). In this case, use a different OAuth 2 grant flow such as [authorization code flow](/entra/identity-platform/v2-oauth2-auth-code-flow) to obtain the access token.
68
+
> If the token is obtained via the [implicit grant flow](/entra/identity-platform/v2-oauth2-implicit-grant-flow), the `wids` claim might not exist. For more information, see [Access tokens in the Microsoft identity platform](/entra/identity-platform/access-tokens). In this case, use a different OAuth 2 grant flow, such as the [authorization code flow](/entra/identity-platform/v2-oauth2-auth-code-flow), to obtain the access token.
69
69
70
-
[!INCLUDE [Azure Help Support](../../../includes/azure-help-support.md)]
70
+
[!INCLUDE [Azure Help Support](../../../includes/azure-help-support.md)]
0 commit comments