我们有一个使用 Graph API 的 Web 应用程序,我们在应用程序注册中授予了它应用程序权限。现在我们想将应用程序放到Microsoft App Source中,是否可以允许其他租户的用户使用我们租户中应用程序注册的权限?例如,其中一个 API 是用于为该租户中的某些用户创建日历事件,如果使用 Multi-Tenancy 应用程序注册,其他租户的人员可以在其租户中成功创建日历事件吗?
最佳答案
if use multi-tenant app registration, can people from other tenant create calendar event in their tenant successfully?
同意@Tiny Wang,是的,我们可以做到这一点, Multi-Tenancy Azure AD应用程序应该获得其他租户的授权,并且当其他租户希望在自己的租户中创建日历事件时,他们应该指定自己的租户ID生成访问 token 时。
您可以实现Get access without a user
并使用应用程序权限来访问创建日历事件。
确保我们需要 get administrator consent
对于我们需要访问的每个租户。
例如,如果在 TenantA
中注册了一个应用。并且您想要访问 TenantB
中的创建日历事件。然后我们需要进行管理员同意,如下所述
并使用TenantB 的管理员帐户
登录以获取TenantB 的管理员同意
在浏览器中访问以下网址。
https://login.microsoftonline.com/{TenantB}/adminconsent
?client_id={ app registered in TenantA}
&state=12345
&redirect_uri={app registered in TenantA}
然后我们将get an access token为租户 B 创建日历事件。
欲了解更多信息,请参阅以下链接:
所以线程| Error trying to access other tenant users calendars, using MS Graph API & Multi tenant support for Microsoft Graph API
关于azure - Multi-Tenancy 的 MS Graph API 权限,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71963043/