我的申请已在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
的管理员同意流?
答案 0 :(得分:1)
发现问题。
我在tenant B
中尝试用于同意的管理员帐户之前已被邀请作为tenant A
中的访客帐户。 guest帐户已从tenant A
中删除,但似乎某种连接仍然存在,这会破坏管理员同意流程。
当我在tenant B
中创建新的管理员帐户并使用新帐户(tenant A
中完全没有历史记录)同意时,它按预期工作。