使用 grah api 获取用户所属的所有租户 [英] Getting all the tenants a user belongs to using grah api
问题描述
I have an app which uses the AUTH v2 auth provider and the common tenant (login.microsoftonline.com/common/v2.0/) for authentication.
Now, since my users can belong to any AAD tenant, and I want my users to be able to select the tenant in which they are performing operations, I started looking for a way to get all the AAD tenants the logged-in user is part of.
I went through the graph API (graph.microsoft.com) documentation and the closest I could find was this: https://graph.microsoft.io/en-us/docs/api-reference/v1.0/api/user_getmemberobjects) but it looks like this operation requires the 'Directory.Read.All' scope which according to graph.microsoft.io/en-us/docs/authorization/permission_scopes requires 'admin consent'.
Is there a way to get all the tenants a logged in user has access to using the graph api, and without requiring admin consent?
This API is not available. Can you indicate the scenario that requires this API, please? Also please file a request for this feature/API on uservoice.
这篇关于使用 grah api 获取用户所属的所有租户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!