繁体   English   中英

如何使用Microsoft Azure中的多租户应用程序在客户端的活动目录中注册应用程序?

[英]How do I register an app in client's active directory using my multi tenant app in microsoft azure?

我已经在Azure订阅中注册了多租户应用程序。 使用此应用程序,我想为我的客户端创建一个OAuth流,以便能够向我授予在其活动目录中创建应用程序的权限。

我们正在使用OpenID连接流来访问Azure AD图形API。

尽管通过控制台使我们的应用成为多租户,但是当客户端(xyz@outlook.com)尝试登录时,我们仍收到以下错误:

User account 'xyz@outlook.com' 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

我使用以下端点获取访问令牌:

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

请帮助我解决此错误

不幸的是, 您暂时无法使用访客用户登录Azure AD Graph Explorer

很久以前,我遇到了与您相同的问题,并且我知道这对客户来说非常重要。 因此,您可以将您的想法发布到此用户语音页面中 ,Azure团队将看到它。 我也会为此投票。

但是,如果您不介意的话,还有其他解决方案:

解决方案1:尝试使用该目录的内部帐户,该帐户的upn以.onmicrosoft.com结尾

解决方案2:尝试使用其他工具来获取访客用户的访问令牌(该帐户也需要是该目录的管理员),例如邮递员。 然后,您可以使用Postman调用Azure AD Graph API。 您可以参考此博客,以将Azure AD Graph API与Postman一起使用。

希望这可以帮助!

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM