MSgraph - 应用程序权限与委托权限
MSgraph - Application Rights vs Delegated rights
我被卡住了,需要建议。
我有一个使用 Excel 作为计算引擎的 MSGraph 功能。
我的桌面应用程序访问 OneDrive 上的 Excel-workbook,输入一些值并读出结果。
我在模拟用户时设法使用委派权限“Files.ReadWrite”执行此操作,以避免应用程序每次都请求对工作簿 execute/access 的许可。
但是当将功能移动到 .Net web 应用程序时,我遇到了麻烦。
.Net 不允许此功能:
“通过 Username/Password 身份验证从权威机构获取安全令牌的非交互式请求。仅在 .net 桌面和 .net 核心上可用。”
因此,我已将代码移至以 .core 编写的 REST 服务。
然后我得到了这个:
状态码”:500,
“消息”:“出现一个或多个错误。(AADSTS53003:访问已被阻止
条件访问策略。访问策略不允许颁发令牌。
如果我的应用程序拥有“Files.ReadWrite.All”应用程序权限,我想我可以解决所有这些问题吗?
我对吗?
我们的 IT 部门认为应用程序权限太危险了。
是否有中间方法,在应用程序上拥有这些权利,并限制可访问性,允许应用程序访问哪些对象?
I think I could solve all this if my application had the Application
Rights "Files.ReadWrite.All"? Am I right?
根据您的提示信息:Non-interactive request to acquire a security token from the authority, via Username/Password Authentication. Available only on .net desktop and .net core.
显然你不能在.Net web应用程序上使用delegated permissions,因为它是一个没有用户交互的请求(即没有用户登录),所以你不能使用username/password-based认证来获取访问令牌。您需要向应用程序授予应用程序权限,然后使用client credential flow获取访问令牌。
But can an app with Application Rights "Files.ReadWrite.All" read all
files on all OneDrives in the organization? Is there any middleway,
to have these Rights on the app, and limit the accessibility, which
objects the app are allowed to access?
您可以根据您要访问的MS graph api为应用程序授予适当的访问权限。我认为Files.ReadWrite.All应用程序权限可以读取组织中所有OneDrive上的所有文件。
委托权限和申请权限,本质区别在于是否有用户登录:
应用程序权限 允许 Azure Active Directory 中的应用程序充当它自己的实体,而不是代表特定用户。
委派权限 允许 Azure Active Directory 中的应用程序代表特定用户执行操作。
所以,我觉得你可以放心使用应用权限。
我被卡住了,需要建议。 我有一个使用 Excel 作为计算引擎的 MSGraph 功能。 我的桌面应用程序访问 OneDrive 上的 Excel-workbook,输入一些值并读出结果。 我在模拟用户时设法使用委派权限“Files.ReadWrite”执行此操作,以避免应用程序每次都请求对工作簿 execute/access 的许可。 但是当将功能移动到 .Net web 应用程序时,我遇到了麻烦。 .Net 不允许此功能: “通过 Username/Password 身份验证从权威机构获取安全令牌的非交互式请求。仅在 .net 桌面和 .net 核心上可用。” 因此,我已将代码移至以 .core 编写的 REST 服务。 然后我得到了这个: 状态码”:500, “消息”:“出现一个或多个错误。(AADSTS53003:访问已被阻止 条件访问策略。访问策略不允许颁发令牌。 如果我的应用程序拥有“Files.ReadWrite.All”应用程序权限,我想我可以解决所有这些问题吗? 我对吗? 我们的 IT 部门认为应用程序权限太危险了。 是否有中间方法,在应用程序上拥有这些权利,并限制可访问性,允许应用程序访问哪些对象?
I think I could solve all this if my application had the Application Rights "Files.ReadWrite.All"? Am I right?
根据您的提示信息:Non-interactive request to acquire a security token from the authority, via Username/Password Authentication. Available only on .net desktop and .net core.
显然你不能在.Net web应用程序上使用delegated permissions,因为它是一个没有用户交互的请求(即没有用户登录),所以你不能使用username/password-based认证来获取访问令牌。您需要向应用程序授予应用程序权限,然后使用client credential flow获取访问令牌。
But can an app with Application Rights "Files.ReadWrite.All" read all files on all OneDrives in the organization? Is there any middleway, to have these Rights on the app, and limit the accessibility, which objects the app are allowed to access?
您可以根据您要访问的MS graph api为应用程序授予适当的访问权限。我认为Files.ReadWrite.All应用程序权限可以读取组织中所有OneDrive上的所有文件。
委托权限和申请权限,本质区别在于是否有用户登录:
应用程序权限 允许 Azure Active Directory 中的应用程序充当它自己的实体,而不是代表特定用户。
委派权限 允许 Azure Active Directory 中的应用程序代表特定用户执行操作。
所以,我觉得你可以放心使用应用权限。