gpt4 book ai didi

azure - 如何允许在 Azure 租户中公开登录我的应用程序注册?

转载 作者:行者123 更新时间:2023-12-02 07:56:35 25 4
gpt4 key购买 nike

我正在尝试创建一个托管在 Azure 中的应用程序,只要您拥有 Microsoft 帐户,该应用程序(应该)允许公共(public)登录。我不在乎它是企业帐户还是个人帐户。您只需要能够登录即可。我正在创建 SPA 和 API。

因此,我转到 Azure 门户并创建了应用注册并配置了应用注册,以允许组织内部或外部的所有用户拥有有效的个人或企业 Microsoft 帐户。

现在 SPA 是一个 Angular 应用程序,我使用 Damien Bod 的 OpenId 库来登录。当我将 stsServer 指向我的登录端点 ( https://login.microsoftonline.com/{my-tenant-id}/v2.0 ) 并登录时,一切正常,除非我使用组织外部的帐户(例如我的个人帐户)。

我收到以下错误:

AADSTS50020: User account '<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="afd7d7d7d7efd7d7d7d781d7d7d7" rel="noreferrer noopener nofollow">[email protected]</a>' from identity provider 'https://sts.windows.net/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/' does not exist in tenant 'Default Directory' and cannot access the application 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'(App Name) 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/v2.0。这允许使用任何 Azure AD/个人 Microsoft 帐户登录。

关于azure - 如何允许在 Azure 租户中公开登录我的应用程序注册?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64502533/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com