angular - 如何在 Azure AD 上注册单租户 SPA?

标签 angular azure oauth-2.0 openid-connect azure-ad-msal

我创建了一个新的 Angular 项目并设置了 MSAL (@azure/msal-angular)。

当我转到 MsalGuarded 路线时,它会正确重定向我进行登录。但是,在提供我的凭据后,我收到一条错误消息:

We're unable to complete your request
unauthorized_client: The client does not exist or is not enabled for consumers. If you are the application developer, configure a new application through the App Registrations in the Azure Portal at https://go.microsoft.com/fwlink/?linkid=2083908.

在 Azure 门户上,我使用重定向 URI http://localhost:4200 注册了 SPA(单租户),因为我不希望为消费者启用它。

我尝试启用/禁用隐式授予,但没有帮助(而且无论如何也不应该为 OAuth2/OpenID Connect 启用它)

我的问题是:是否可以注册单租户 SPA?或者单一租户只与私有(private)客户合作?

最佳答案

这取决于您是否要将 spa 应用程序公开给其他帐户。如果您使用https://login.microsoftonline.com/common/,则表示它接受任何帐户,那么您需要选择我的应用程序,然后转移到身份验证选项卡,然后在支持的帐户类型下,选择任何组织目录中的帐户(任何 Azure AD 目录 - Multi-Tenancy )

如果您想将 spa 应用程序限制为该租户使用,即不向其他租户公开,您可以尝试 https://login.microsoftonline.com/tenant id/https://login.microsoftonline.com/organizations/登录。

关于angular - 如何在 Azure AD 上注册单租户 SPA?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66087813/

相关文章:

javascript - 足够安全且最简单的 SPA 身份验证方式

spring-mvc - OAuth2 Spring Security - OAuth2AuthenticationProcessingFilter 不工作

javascript - 检查数组中是否有任何项等于该值

spring - Angular 6(前端)+ Spring : Configuring Routing

angular - 为什么表单错误的 getter 在我的 Angular Reactive Form 组件模板中不起作用,但直接引用却可以?

azure - 尝试将源添加到 Language Studio 知识库时出现不受支持/无效的 URL

Angular Observable HttpInterceptor ForkJoin 不起作用

c# - 完全的 azure 新手 - 它是什么以及如何检查我的更改是否已提交

azure - 使用 Azure 进行本地托管

node.js - Discord Oauth2 加入公会