gpt4 book ai didi

代表 Azure AD Multi-Tenancy 应用程序的 Azure 资源管理器

转载 作者:行者123 更新时间:2023-12-02 08:30:56 25 4
gpt4 key购买 nike

我想要实现的目标的总体概述

我正在尝试构建一个 Azure AD Multi-Tenancy Web 应用程序,该应用程序允许我使用 Azure 资源管理器 (ARM) API 管理客户订阅/租户中的资源。我对 Azure AD Multi-Tenancy 还很陌生。

理想的控制流程

1. A customer browses the Applications (ideal an admin of the customer tenant)
2. Will be granted with Azure AD authorize flow
3. Accepts everything and grants admin consent for the AD App in their tenant
4. Unclear: The AD App will be granted contributer access on a subscription or resource
5. My Web App will be able to use the AD App credentials to manage the customer resources using the ARM APIs

问题

步骤 1-3、5:很清晰,我知道如何构建它。
第 4 步:我不确定如何构建该步骤,以便该步骤自动发生。

我考虑过的解决方案

最糟糕的情况是客户 AD 管理员必须使用 Azure 门户手动授予 AD 应用对订阅或资源的访问权限。

最佳答案

我想到的一个想法是,您需要 Azure 服务管理 API 的 user_impersonation 权限。用户登录后,您可以列出可用的订阅,允许用户选择一项。然后根据需要列出资源组。

用户确认选择后,您的应用可以代表当前登录的用户通过管理 API 将自身添加为目标资源的贡献者。

为此,您将需要在目标租户中创建的应用程序的服务主体的对象 ID。您可以通过获取仅限应用程序的 token 来获取它,例如用户登录后,从该租户的 token 端点访问 Azure 管理 API。该 token 将包含一个 oid 声明,它是服务主体的对象 ID。

当然,登录的用户必须能够修改对目标资源的访问权限。

我想说这种方法的缺点是组织必须信任您的应用程序只做它声称要做的事情。他们手动授予访问权限的方法使他们能够完全控制。

关于代表 Azure AD Multi-Tenancy 应用程序的 Azure 资源管理器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61100291/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com