简体   繁体   English

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

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

I have registered a multi-tenant app in my Azure subscription. 我已经在Azure订阅中注册了多租户应用程序。 using this App, I want to create an OAuth flow for my client to be able to give me permissions to create an app in his active directory. 使用此应用程序,我想为我的客户端创建一个OAuth流,以便能够向我授予在其活动目录中创建应用程序的权限。

We are using OpenID connect flow to access the Azure AD graph API. 我们正在使用OpenID连接流来访问Azure AD图形API。

In spite of making our app multi-tenanted via the console, we are getting the following error when the client (xyz@outlook.com) tries to sign in: 尽管通过控制台使我们的应用成为多租户,但是当客户端(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

I used the following endpoint to get an access 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

Please help me to resolve this error 请帮助我解决此错误

Unfortunately, you cannot use a guest user to login Azure AD Graph Explorer for now. 不幸的是, 您暂时无法使用访客用户登录Azure AD Graph Explorer

I came across the same issue as yours long time ago and I understand it's very important for customers. 很久以前,我遇到了与您相同的问题,并且我知道这对客户来说非常重要。 So, you can post your idea in this User Voice Page and the Azure Team will see it. 因此,您可以将您的想法发布到此用户语音页面中 ,Azure团队将看到它。 I will also upvote for it. 我也会为此投票。

But there are other solutions if you don't mind: 但是,如果您不介意的话,还有其他解决方案:

Solution 1: Try to use an internal account of that directory which upn ends with .onmicrosoft.com 解决方案1:尝试使用该目录的内部帐户,该帐户的upn以.onmicrosoft.com结尾

Solution 2: Try to use other tools to get access token with a guest user(this account also need to be an admin of that directory), such as postman. 解决方案2:尝试使用其他工具来获取访客用户的访问令牌(该帐户也需要是该目录的管理员),例如邮递员。 Then you can use Postman to call Azure AD Graph API. 然后,您可以使用Postman调用Azure AD Graph API。 You can refer to this blog to use Azure AD Graph API with Postman. 您可以参考此博客,以将Azure AD Graph API与Postman一起使用。

Hope this helps! 希望这可以帮助!

暂无
暂无

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

相关问题 Microsoft 多租户应用程序作为个人开发人员 - Azure Active Directory - Microsoft Multi Tenant App as an Individual Developer - Azure Active Directory Azure Active Directory - 支持多租户同意应用方案 - Azure Active Directory - supporting multi-tenant consented app scenario 如何从客户端应用程序针对Azure Active Directory进行身份验证? - How do I authenticate against Azure Active Directory from my client app? 如何在开发期间同意 Azure Active Directory 企业应用程序进行多租户登录而无需发布者批准? - How to consent to an Azure Active Directory Enterprise App for Multi-Tenant Login without Publisher Approval during development? 如何跨活动目录添加权限? (有关在天蓝色中设置多租户应用程序的问题) - how to add permissions across active directory? (problems with setting up multi-tenant app in azure) Azure 多租户 saas 应用程序,如何为每个环境注册应用程序? - Azure multi tenant saas app, how to register Application per environment? 如何使用多租户ASP.NET应用程序通过Azure Active Directory进行身份验证? - How do I authenticate via Azure Active Directory with multi-tenant ASP.NET applications? 如何在Microsoft Azure中注册我的应用程序? - How can i register my app in Microsoft Azure? Azure Active Directory - 如何为租户下注册的应用程序提供 http redirectUri - Azure Active Directory - How to give an http redirectUri for my registered app under tenant 如何允许客户租户在我的多租户 Azure AD 应用程序中添加自定义角色 - How to allow Client Tenants to add custom roles in my multi tenant Azure AD app
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM