Azure Active Directory Multi-Tenancy : User doesn't exist in tenant

标签 azure azure-active-directory

我是 AAD 新手,我正在尝试允许当前租户(我设置 AAD 的租户)之外的租户中的用户登录。我正在测试两个 Outlook 帐户。当我使用其他 Outlook 帐户登录时,出现错误:

“AADSTS50020:来自身份提供商“live.com”的用户帐户“[email protected]”在租户“默认目录”中不存在,并且无法访问该租户中的应用程序“”。需要将该帐户添加为外部首先注销租户中的用户。注销并使用不同的 Azure Active Directory 用户帐户重新登录。”

我不想邀请任何用户加入我的租户,因为如果有更多用户,也必须邀请他们。我将配置设置为 Multi-Tenancy (组织和个人帐户),并且我的 api 访问 /common 端点。

我有什么遗漏的吗?或者我误解了 Multi-Tenancy 的工作原理?谢谢!

最佳答案

"AADSTS50020: User account '<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="6c191f091e2c03191800030307420f0301" rel="noreferrer noopener nofollow">[email protected]</a>' from identity provider 'live.com' does not exist in tenant 'Default Directory' and cannot access the application '' in that tenant

每当 guest 用户尝试访问资源租赁中的资源或应用程序、登录过程失败并显示错误时,就会发生此错误。

要解决此问题,转至 azure 门户 -> 应用注册 -> 您的应用 -> list -> 检查 signInAudience ->AzureADandPersonalMicrosoftAccount 如下所示。

enter image description here

  • 如果您的 list 中缺少 signInAudience 属性,请尝试通过选择适当的帐户类型来重新创建应用注册。
  • 如果用户使用其个人帐户登录您的租户,则即使您选择 Multi-Tenancy 帐户类型,也需要将他们添加为访客用户。

如果有更多用户,您可以通过修改 UserInviteTemplate.csv 文件来使用批量邀请选项,如下所示。

  1. 转到 Azure Active Directory -> 用户 -> 批量操作 -> 下载 csv 模板

enter image description here

  • 在模板中,添加要邀请的用户电子邮件地址列表,如下所示。
  • enter image description here

  • 批量邀请用户上传UserInviteTemplate.csv文件。
  • enter image description here

  • 要检查是否添加了访客用户,您可以过滤user type == guest,如下所示。
  • enter image description here

    关于Azure Active Directory Multi-Tenancy : User doesn't exist in tenant,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/73496129/

    相关文章:

    c# - 登录后使用 oidc 和浏览器后退按钮的带有 azure 广告的 netcore 导致异常

    azure - VSCode 主题不会发布到 Azure

    amazon-web-services - 如何在 Microsoft Azure 上部署 Ultralytics YOLOv8?

    azure - 运行由 VS2019 创建的 Azure Docker 容器注册表

    asp.net - Azure AD 中的 jwt-bearer 代表授权问题

    Azure应用程序注册: scope list not complete

    sql - 使用适用于 Windows Phone 的 odata 客户端库插入 Unicode 字符串

    azure - "Update User"操作在 Microsoft Graph API 中给出 "Insufficient privileges to complete the operation.' 错误

    无需打开浏览器即可实现 Azure MFA

    azure - 无法从我的逻辑应用获取 Azure Active Directory 组