具有单个应用程序注册的Microsoft Graph API的多租户访问权限?

问题描述 投票:0回答:1

我有多个带有多个租户的邮箱。我想知道是否可以通过单个应用程序注册访问图形API?

azure-ad-graph-api
1个回答
0
投票

是。您可以这样做。

Register your Azure AD应用为多租户。您需要选择“任何组织目录中的帐户”。

enter image description here

并且您需要实现Get access without a user并使用“应用程序”权限来访问邮箱。最重要的是每个租户都要get administrator consent

我们假设此应用已在TenantA中注册。现在,您要访问TenantB中的邮箱。然后,您应该征得管理员的同意,例如:在浏览器中访问以下URL。

https://login.microsoftonline.com/{TenantB}/adminconsent
?client_id={cliend id of registered app in TenantA}
&state=12345
&redirect_uri={redirect_uri of registered app in TenantA}

使用TenantB的管理员帐户登录以进行TenantB的管理员同意。

之后,您可以Get an access token使TenantB访问TenantB中的邮箱。

© www.soinside.com 2019 - 2024. All rights reserved.