【发布时间】:2020-01-14 17:12:32
【问题描述】:
我的 Angular .net core 2.0 应用程序使用 oauth2.0 身份验证,我在 startup.cs 中配置了相同的。 PFB代码
services.AddAuthentication(options =>
{
options.DefaultScheme = CookieAuthenticationDefaults.AuthenticationScheme;
options.DefaultChallengeScheme = OpenIdConnectDefaults.AuthenticationScheme;
options.DefaultSignInScheme = CookieAuthenticationDefaults.AuthenticationScheme;
})
.AddCookie()
.AddOpenIdConnect(options =>
{
options.ClientId = azureAdConfig.ClientId;
options.ClientSecret = azureAdConfig.ClientSecret;
options.Authority = string.Format(azureAdConfig.AADInstance, azureAdConfig.Tenant);
options.ResponseType = OpenIdConnectResponseType.CodeIdToken;
options.Resource = azureAdConfig.ResourceURI_Graph;
options.Events = new AuthEvents(azureAdConfig, connectionStringsConfig);
});
应用程序运行良好,但现在我想限制应用程序供一组用户使用。为此,我在 Azure AD 应用程序中添加了所需的用户和组。
然后我在 azure app 服务中启用了以下设置。
我还在 Azure AD 企业应用程序中启用了需要用户分配设置。 PFB
但是现在,当我访问应用程序时,我收到以下错误:(我已添加所需的回复网址)
【问题讨论】:
-
这是 Azure B2C 吗?
-
@TiagoBrenck No
标签: .net azure asp.net-core azure-active-directory azure-web-app-service