Skip to content

Commit d3f5c80

Browse files
author
Simonx Xu
authored
Merge pull request #8775 from AmandaAZ/Branch-CI4681
AB#4681: Convert blog post to article
2 parents 3ab8d3d + 6b376ae commit d3f5c80

2 files changed

Lines changed: 40 additions & 0 deletions

File tree

support/entra/entra-id/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,8 @@
292292
href: users-groups-entra-apis/cannot-modify-user-mail-phone-attributes.md
293293
- name: Error "The identity of the calling application could not be established"
294294
href: users-groups-entra-apis/identity-of-calling-application-not-established.md
295+
- name: Can't look up users using the /users endpoint
296+
href: users-groups-entra-apis/cannot-look-up-users-using-microsoft-graph-users-endpoint.md
295297
- name: Add an owner to an application
296298
href: users-groups-entra-apis/add-owner-for-application-microsoft-graph.md
297299
- name: NoPermissionsInAccessToken when calling me endpoint
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
title: Can't Look Up Users Using Microsoft Graph /Users Endpoint
3+
description: Provides a solution to an issue where a user can't look up other users using the Microsoft Graph /users endpoint when a tenant policy configuration restricts access.
4+
ms.date: 04/30/2025
5+
ms.service: entra-id
6+
ms.custom: sap:Getting access denied errors (Authorization)
7+
ms.reviewer: daga, v-weizhu
8+
---
9+
# 401 HTTP response when looking up users using the Microsoft Graph /users endpoint
10+
11+
You can use the Microsoft Graph endpoint to interact programmatically with your tenant data. A common scenario is to use a Microsoft Graph `/users` endpoint to look up users in the tenant. In this case, if you use delegated permissions in your access token, the `User.Read.All` permission is necessary. There are ways to prevent you from looking up other users, such as using an [authorizationPolicy](/graph/api/resources/authorizationpolicy) object that can control Microsoft Entra authorization settings, unless you're a tenant administrator.
12+
13+
This article provides a solution to an issue where you can't look up other users using the Microsoft Graph `/users` endpoint after a tenant policy configuration restricts access to other users.
14+
15+
## Symptoms
16+
17+
After you enable an `authorizationPolicy` object in your tenant to prevent the user lookup action, a new application receives a 401 HTTP response when it performs this action. This issue occurs even though the proper permissions are consented to during app registration and the access token has the proper permissions.
18+
19+
## Cause
20+
21+
The `allowedToReadOtherUser` property in the `authorizationPolicy` is set to `false`. This setting prevents the default user role from reading other users. You can check its value via a `GET` request:
22+
23+
`GET https://graph.microsoft.com/v1.0/policies/authorizationPolicy`
24+
25+
## Solution
26+
27+
To resolve this issue, set the value of the `allowedToReadOtherUser` property to `true` via a `PATCH` request as follows:
28+
29+
```msgraph
30+
PATCH https://graph.microsoft.com/v1.0/policies/authorizationPolicy
31+
{
32+
"defaultUserRolePermissions": {
33+
"allowedToReadOtherUsers": true
34+
}
35+
}
36+
```
37+
38+
[!INCLUDE [Azure Help Support](../../../includes/azure-help-support.md)]

0 commit comments

Comments
 (0)