Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/33.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angular 如何在Azure AD上注册单个租户SPA?_Angular_Azure_Oauth 2.0_Openid Connect_Msal - Fatal编程技术网

Angular 如何在Azure AD上注册单个租户SPA?

Angular 如何在Azure AD上注册单个租户SPA?,angular,azure,oauth-2.0,openid-connect,msal,Angular,Azure,Oauth 2.0,Openid Connect,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 dev

我创建了一个新的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注册了一个SPA,即单租户http://localhost:4200,因为我不希望为消费者启用它

我尝试了启用/禁用隐式授权,但没有任何帮助(并且无论如何都不应该为OAuth2/OpenID Connect启用)


我的问题是:是否可以注册一个单租户SPA?或者单个租户是否只与私人客户一起工作?

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


如果要将spa应用程序限制在此租户,即不将其公开给其他租户,可以尝试
https://login.microsoftonline.com/tenant id/
https://login.microsoftonline.com/organizations/
登录。

权限设置为
https://login.microsoftonline.com/tenant id/