我已在我的 Azure 订阅中注册了 Multi-Tenancy 应用程序。使用此应用程序,我想为我的客户创建一个 OAuth 流程,以便能够授予我在其事件目录中创建应用程序的权限。
我们正在使用 OpenID 连接流来访问 Azure AD 图形 API。
尽管通过控制台使我们的应用程序成为 Multi-Tenancy ,但当客户端 ( [email protected] ) 尝试登录时,我们仍会收到以下错误:
User account '<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="e49c9d9ea48b9190888b8b8fca878b89" rel="noreferrer noopener nofollow">[email protected]</a>' from identity provider 'live.com' does not exist in tenant 'Default Directory' and cannot access the application 'bf5ca806-xxxx-xxxx-xxx-xxxx' in that tenant. The account needs to be added as an external user in the tenant first. Sign out and sign in again with a different Azure Active Directory user account
我使用以下端点来获取访问 token :
https://login.microsoftonline.com/common/oauth2/authorize?
client_id=xxxxxxxx-xxxx-xxxxx-xxxx-xxxxx
&response_mode=form_post
&response_type=code+id_token
&redirect_uri=http://localhost:8080
&prompt=admin_consent
&nonce=1234
&resource=https://graph.windows.net
请帮我解决这个错误
最佳答案
遗憾的是,您目前无法使用 guest 用户登录 Azure AD Graph Explorer。
我很久以前就遇到了与您相同的问题,我知道这对客户来说非常重要。所以,你可以在这个 User Voice Page 发表你的想法Azure 团队将会看到它。我也会投赞成票。
但如果您不介意,还有其他解决方案:
解决方案 1:尝试使用该目录的内部帐户(upn 以 .onmicrosoft.com
解决方案2:尝试使用其他工具来获取访客用户的访问 token (该帐户还需要是该目录的管理员),例如postman。然后您可以使用Postman调用Azure AD Graph API。您可以引用this blog将 Azure AD Graph API 与 Postman 结合使用。
希望这有帮助!
关于azure - 如何使用 Microsoft Azure 中的 Multi-Tenancy 应用程序在客户端的 Active Directory 中注册应用程序?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48144767/