Asp.net mvc 5 无法使用OpenIDConnect解决Azure AD身份验证后的无限循环问题-授权码授予
我们正在ASP.NET MVC 5中使用Open ID Connect实现Azure AD身份验证。当应用程序在本地运行时,我们有windows身份验证,因此没有登录页面或登录按钮 我们为所有控制器设置了[Authorize]属性,以便在访问页面之前对用户进行身份验证。下面是启动验证中的代码Asp.net mvc 5 无法使用OpenIDConnect解决Azure AD身份验证后的无限循环问题-授权码授予,asp.net-mvc-5,azure-active-directory,infinite-loop,openid-connect,Asp.net Mvc 5,Azure Active Directory,Infinite Loop,Openid Connect,我们正在ASP.NET MVC 5中使用Open ID Connect实现Azure AD身份验证。当应用程序在本地运行时,我们有windows身份验证,因此没有登录页面或登录按钮 我们为所有控制器设置了[Authorize]属性,以便在访问页面之前对用户进行身份验证。下面是启动验证中的代码 app.UseKentorOwinCookieSaver(); app.UseCookieAuthentication(new CookieAuthenticationOptions
app.UseKentorOwinCookieSaver();
app.UseCookieAuthentication(new CookieAuthenticationOptions
{
AuthenticationType = "Cookies",
CookieManager = new Microsoft.Owin.Host.SystemWeb.SystemWebChunkingCookieManager()
});
app.UseOpenIdConnectAuthentication(
new OpenIdConnectAuthenticationOptions
{
ClientId = clientId,
Authority = authority,
PostLogoutRedirectUri = postLogoutRedirectUri,
RedirectUri = RedirectUri,
ResponseType = OpenIdConnectResponseType.Code,
Notifications = new OpenIdConnectAuthenticationNotifications()
{
AuthenticationFailed = (context) => {
context.HandleResponse();
return Task.FromResult(0);
}
}
});
但一旦用户通过身份验证,我们就面临无限循环。我在互联网上尝试了所有的解决方案,但我的问题没有解决
我记得曾经通过创建一个控制器操作来解决这个问题,该操作将回复URL与AllowAnonymous匹配。。这在Core中要容易得多:/我记得曾经通过创建一个控制器操作来解决它,该操作将回复URL与AllowAnonymous匹配。。这些东西在核心方面要容易得多:/