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

标签 azure authentication azure-active-directory openid

我正在尝试创建一个托管在 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/

相关文章:

java - 如何将 JDBC azure sql 服务器连接到 Android 应用程序?

azure - 合并 Azure Active Directory

azure - 从 VisualStudio 发布的 WebJob 自动插入连接字符串

javascript - Nodejs Passport 失败消息不起作用

java - Android:下载受 NTLM 身份验证保护的文件

azure - 如何在 Azure 中向 Microsoft Teams Bot 添加授权

rest - 使用 REST 获取 Azure VM 的资源消耗详细信息和成本核算

php - 如何在 CakePHP 2.0.4 中为 Auth 组件使用不同的模型?

azure - 使用 PSKeyVaultCertificate 向 Azure 服务主体添加身份验证时出现请求错误

azure - 将策略与 azure 应用程序注册结合使用与将策略与 azure b2c 应用程序结合使用