管理员同意向租户注册的申请访问租户B中的图形访问权限



我的应用程序在tenant A中注册,需要Microsoft Graph权限Invite guest users to the organization。该应用程序是一个没有GUI的API应用。

Tenant A中的应用程序 Graph访问,我会执行以下操作:
1.转到https://login.windows.net/common/oauth2/authorize?response_type=code&client_id= <My application ID>&prompt=admin_consent
2.使用tenant A的管理凭据登录

完成 - tenant A中的Service Principal现在有Invite guest users to the organization许可

到目前为止一切都很好。现在,我想给出相同的应用程序访问权限,以邀请tenant B中的访客用户。我该怎么做?

我尝试了与以前相同的流程:
1.转到https://login.windows.net/common/oauth2/authorize?response_type=code&client_id= <My application ID>&prompt=admin_consent
2.使用tenant B的管理凭据登录

这将导致以下错误消息:

aadsts50020:从身份提供商'yyy.com''yyy.com'的用户帐户'xxx@yyy.com'不存在于租户'租户a'''',并且无法访问该应用程序的'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'。该帐户需要首先作为租户中的外部用户添加。登录并再次使用不同的Azure Active Directory用户帐户登录。

似乎即使我从Tenant B登录admin凭据,此操作也试图在Tenant A中为应用程序提供所需的权限。

如何在Tenant B中授予应用程序所需的权限?是否可以使用Tenant BService Principal ID而不是Global Application ID使用管理员同意流?

找到了问题。

我尝试使用tenant B中同意使用的管理帐户以前已被邀请作为tenant A中的访客帐户。此后,该来宾帐户已从tenant A中删除,但似乎仍然存在某种连接,这些连接仍在破坏管理员同意流的某个地方。

当我在tenant B中创建一个新的管理员帐户并使用新帐户(在tenant A中根本没有历史记录)同意时,它按预期工作。

最新更新