How to Get list of users by organization id using Graph API?

Dmitry Haletsky 0 Reputation points
2023-10-19T13:32:57.9433333+00:00

I have Multitenant application in Azure.

According to List User request I can collect users but the main problem is that this request returns Mixture of users of all the organizations which use my app.

Is it possible to filter users by organization ID or tenant ID?

Many Thanks

Microsoft Security | Microsoft Graph
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Vahid Ghafarpour 23,385 Reputation points Volunteer Moderator
    2023-10-19T13:52:56.61+00:00

    Utilize claims in the access token issued by Azure AD to include information about the tenant. You can use optional claims or standard claims like tid (tenant ID) to determine the tenant to which a user belongs.

    https://learn.microsoft.com/en-us/azure/active-directory/develop/optional-claims

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.