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
Copy file name to clipboardExpand all lines: support/entra/entra-id/users-groups-entra-apis/error-call-me-endpoint-microsoft-graph.md
+15-13Lines changed: 15 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,11 +8,11 @@ ms.reviewer: willfid, v-weizhu
8
8
---
9
9
# NoPermissionsInAccessToken when calling /me endpoint
10
10
11
-
This article describes an issue in which the you receive `NoPermissionsInAccessToken` error when you call `/me` endpoint in Microsoft Graph. It also explains why you cannot call the `/me` endpoint with a token acquired via the client credentials grant flow
11
+
This article discusses an issue in which the you receive a `NoPermissionsInAccessToken` error message when you call the `/me` endpoint in Microsoft Graph. This article also explains why you can't call the `/me` endpoint by using a token that's acquired through the client credentials grant flow.
12
12
13
13
## Symptoms
14
14
15
-
When you try to call the `/me` endpoint from your Microsoft Entra ID-based application that use[client credentials grant flow](/entra/identity-platform/v2-oauth2-client-creds-grant-flow), the following error may occur:
15
+
When you try to call the `/me` endpoint from your Microsoft Entra ID-based application that uses[client credentials grant flow](/entra/identity-platform/v2-oauth2-client-creds-grant-flow), you receive the following error message:
16
16
17
17
·```output
18
18
{
@@ -29,36 +29,38 @@ When you try to call the `/me` endpoint from your Microsoft Entra ID-based appli
29
29
}
30
30
}
31
31
·```
32
+
32
33
## Cause
33
34
34
-
The `/me` endpoint is designed to allow signed-in users to retrieve their own information. To call the `/me` endpoint, it requires a user context because it uses delegated permissions. This means that a token generated by using the client credentials grant flow can't use the `/me` endpoint due to the absence of user context information.
35
+
The `/me` endpoint is designed to enable signed-in users to retrieve their own information. To call the `/me` endpoint, you must provide some user context because the endpont uses delegated permissions. This means that a token that's generated by using the client credentials grant flow can't use the `/me` endpoint because the user context information is absent.
35
36
36
-
Tokens obtained using the client credentials grant flow represent application identities, not user identities. These tokens contain a **roles** claim for application permissions instead of a scp (scopes) claim for delegated permissions. The absence of user context makes it impossible for the `/me` endpoint to determine the user associated with the request.
37
+
Tokens that are obtained by using the client credentials grant flow represent application identities, not user identities. These tokens contain a **roles** claim for application permissions instead of a scp (scopes) claim for delegated permissions. The absence of user context makes it impossible for the `/me` endpoint to determine the user who's associated with the request.
37
38
38
-
####Example tokens
39
+
### Example tokens
39
40
40
41
**Token with user context (delegated flow with a user signed in)**
41
42
42
-
This token is granted by using delegated flow with a user signed in. It contains user-specific information and a `scp` claim that contains current user's the permissions:
43
+
This token is granted by using delegated flow to which a user signed in. It contains user-specific information and a `scp` claim that contains the current user's permissions.
:::image type="content" source="media/error-call-me-endpoint-microsoft-graph/token-sign-in-user-context.png" alt-text="Screenshot that shows a delegated token example." lightbox="media/error-call-me-endpoint-microsoft-graph/token-sign-in-user-context.png":::
45
46
46
47
**Token with application identity (client_credentials grant flow)**
47
48
48
-
This token is generated by using the client credentials grant flow. It doesn't contain user-specific information, but contains a `roles` claim for application permissions:
49
+
This token is generated by using the client credentials grant flow. It doesn't contain user-specific information. Insead, it contains a `roles` claim for application permissions.
:::image type="content" source="media/error-call-me-endpoint-microsoft-graph/token-application-context.png" alt-text="Screenshot that shows an application token example." lightbox="media/error-call-me-endpoint-microsoft-graph/token-application-context.png":::
51
52
52
53
## Solution
53
54
54
-
When you use the client credentials grant flow in your application, you must use the `/users` endpoint instead of the `/me` endpoint. This allows you to retrieve user-specific information using application tokens.
55
+
When you use the client credentials grant flow in your application, you must use the `/users` endpoint instead of the `/me` endpoint. This enables you to retrieve user-specific information by using application tokens.
55
56
56
-
For example, if you want to call `GET https://graph.microsoft.com/v1.0/me/memberOf` to get a list of groups a user is a member of, use the following method:
57
+
For example, if you want to call `GET https://graph.microsoft.com/v1.0/me/memberOf` to generate a list of groups that a user is a member of, use the following method:
57
58
58
-
1. Obtain an application token using the client credentials grant flow.
59
-
2.Ensure that the application has the **User.Read.All** permission to query user information.
59
+
1. Obtain an application token by using the client credentials grant flow.
60
+
2.Make sure that the application has the **User.Read.All** permission to query user information.
60
61
3. Use the **users** endpoint to query specific user details. Replace {upn} with the User Principal Name (UPN) or User Object ID of the user.
61
62
```
62
63
GET https://graph.microsoft.com/v1.0/users/{upn or userID}/memberOf
63
64
```
65
+
64
66
[!INCLUDE [Azure Help Support](../../../includes/azure-help-support.md)]
0 commit comments