如何使用MS Graph访问存储在没有管理员权限的组中的文件(How to use MS Graph to access files stored in a group without adminis

编程入门 行业动态 更新时间:2024-10-12 05:56:15
如何使用MS Graph访问存储在没有管理员权限的组中的文件(How to use MS Graph to access files stored in a group without administrator privileges)

我的应用程序需要访问存储在组的默认文档库中的文件,如文档中所述:

/groups/{group-id}/drive

为了做到这一点,应用程序需要获取组ID。 但根据这篇文章和文档,如果应用程序想要读取用户的组信息,那么经过身份验证的用户需要管理员权限。

如果经过身份验证的用户没有管理员权限,应用程序如何获取组ID?

My app needs to access the files stored in a group's default document library as described in the docs like this:

/groups/{group-id}/drive

In order to do this the app needs to obtain the group ID. But according to this post and the documentation the authenticated user needs administrator privileges if the app wants to read the users's group information.

How can the app obtain a group ID if the authenticated user does not have admin privileges?

最满意答案

您的应用程序需要由管理员同意,然后才能访问所需的信息。 访问组所需的权限范围(Groups.Read或Groups.ReadWrite)需要管理员同意,并且管理员可以代表整个组织同意,在这种情况下,当普通用户使用该应用程序时,他们将不会看到同意用户界面和应用程序将能够代表他们访问信息。 代码示例在这里: https : //github.com/Azure-Samples/active-directory-dotnet-admin-restricted-scopes-v2

Your app need to be consented once by the administrator and after that it can access the information it requires. The permission scope required to access groups (Groups.Read or Groups.ReadWrite) require an administrator to consent, and the administrator can consent on behalf of the entire organization, in this case when a regular user uses the app they will not see a consent UI and the app will be able to access the information on their behalf. Code sample here: https://github.com/Azure-Samples/active-directory-dotnet-admin-restricted-scopes-v2

更多推荐

本文发布于:2023-07-15 07:16:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1111408.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何使用   组中   管理员权限   文件   Graph

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!