管理员同意在租户B中注册已在租户B中注册的应用

时间:2017-12-08 16:26:47

标签: azure microsoft-graph azure-ad-b2b

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

要在Graph中授予应用Tenant A访问权限,请执行以下操作:
1.转到https://login.windows.net/common/oauth2/authorize?response_type=code&client_id= <My application ID>&prompt=admin_consent
2.使用tenant A

的管理员凭据登录

完成 - Service Principal tenant A Invite guest users to the organization现已获得tenant B权限

到目前为止一切顺利。现在,我想为https://login.windows.net/common/oauth2/authorize?response_type=code&client_id= <My application ID>&prompt=admin_consent中的访客用户提供相同的应用程序访问权限。我该怎么做?

我尝试过和以前一样的流程:
1.转到tenant B
2.使用Tenant A

的管理员凭据登录

这会导致以下错误消息:

  

AADSTS50020:来自身份提供商'yyy.com'的用户帐户'xxx@yyy.com'在租户'租户A'中不存在,并且无法访问该租户中的应用'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' 。该帐户需要首先作为外部用户添加到租户中。注销并使用其他Azure Active Directory用户帐户重新登录。

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

如何在Service Principal ID中为应用程序提供所需的权限?对于我的应用,是否可以使用来自Tenant B的{​​{1}}代替全局Application ID的管理员同意流?

1 个答案:

答案 0 :(得分:1)

发现问题。

我在tenant B中尝试用于同意的管理员帐户之前已被邀请作为tenant A中的访客帐户。 guest帐户已从tenant A中删除,但似乎某种连接仍然存在,这会破坏管理员同意流程。

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