gpt4 book ai didi

azure - 是否可以通过Graph或PowerShell查询可用的服务原理API?

转载 作者:行者123 更新时间:2023-12-03 00:24:32 25 4
gpt4 key购买 nike

我正在自动请求 AAD 服务主体/应用程序,或更具体地说是 API,并尝试使用 Graph 或 PowerShell 提取通过门户可用的所有 API 的列表。

具体来说,如果您进入应用程序并单击“API 权限”选项卡,您将获得 API 集合列表,然后深入查看“委派或应用程序权限”,最后是 API。任何以编程方式遍历这棵树的方法都会很棒!

我对这份名单的曝光并不抱太大希望,但希望有人能提供帮助。

提前致谢,安迪

最佳答案

当然,您可以从 MS Graph API 查询服务主体并获取您需要的内容:https://learn.microsoft.com/en-us/graph/api/serviceprincipal-list?view=graph-rest-beta&tabs=http .

这将为您提供所有服务主体的列表:https://learn.microsoft.com/en-us/graph/api/resources/serviceprincipal?view=graph-rest-beta .

您还可以使用 AzureAD PowerShell 模块的 cmdlet Get-AzureADServicePrincipal 来获取此数据。

无论您以何种方式获取数据,您可以在 oauth2Permissions 属性下找到委派权限。

The OAuth 2.0 permissions exposed by the associated application. For more information see the oauth2Permissions property definition on the application entity. Not nullable.

应用程序权限可在 appRoles 属性中找到。

The application roles exposed by the associated application. For more information see the appRoles property definition on the application entity. Not nullable.

但是,并非所有 appRoles 都是应用程序权限。appRole 有 allowedMemberTypes 属性:

Specifies whether this app role definition can be assigned to users and groups by setting to "User", or to other applications (that are accessing this application in daemon service scenarios) by setting to "Application", or to both.

因此您想要检查 appRoles 中是否有“Application”作为允许的成员类型,这些是应用程序权限。

关于azure - 是否可以通过Graph或PowerShell查询可用的服务原理API?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60760340/

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