asp.net-mvc-5 – Windows身份验证在ASP.NET MVC 5网络应用程序中不起作用
发布时间:2020-05-24 09:02:55 所属栏目:asp.Net 来源:互联网
导读:我有一个ASP.NET MVC 5应用程序,并尝试启用 Windows身份验证.开发机器是Windows Server 2008 R2,IIS Express 8.0,Visual Studio 2013 .NET Framework 4.5. 当我浏览应用程序时,我发现404未找到错误.该应用程序使用http:// localhost:63455 / Account / Logi
|
我有一个ASP.NET MVC 5应用程序,并尝试启用 Windows身份验证.开发机器是Windows Server 2008 R2,IIS Express 8.0,Visual Studio 2013& .NET Framework 4.5. 当我浏览应用程序时,我发现404未找到错误.该应用程序使用http:// localhost:63455 / Account / Login?ReturnUrl = /进入重定向循环.最终,ReturnUrl最终变得非常大,因为它被附加到每个重定向. 我的web.config看起来像这样: <system.web>
<authentication mode="Windows"/>
</system.web>
我已经尝试在开发服务器属性上设置匿名身份验证和Windows身份验证设置. 我也尝试添加以下appSettings: <add key="autoFormsAuthentication" value="false"/> <add key="enableSimpleMembership" value="false"/> 如何使Windows身份验证正常工作? 解决方法Startup.Auth.cs中的ConfigureAuth方法包含以下需要为Windows身份验证删除的代码.该代码用于使用OWIN进行表单验证. // Enable the application to use a cookie to store information for the signed in user
app.UseCookieAuthentication(new CookieAuthenticationOptions
{
AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,LoginPath = new PathString("/Account/Login")
});
// Use a cookie to temporarily store information about a user logging in with a third party login provider
app.UseExternalSignInCookie(DefaultAuthenticationTypes.ExternalCookie); (编辑:安卓应用网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- asp.net – Visual Studio开发服务器使用错误的端口
- asp.net-mvc-3 – 如何在Razor视图引擎中注册程序集
- asp.net-mvc – asp fontawesome 404(未找到)
- asp.net – 为什么这违反了类型约束?
- asp.net-mvc-4 – 如何在服务器上安装ASP.NET MVC4 RC(2008
- asp.net – jqgrid第1页的x pager
- asp.net-mvc-3 – 如何在控制器方法的新选项卡中打开cshtml
- asp.net-mvc-3 – 检查ViewBag是否具有属性,以有条件地注入
- asp.net-mvc – asp.net mvc错误处理的最佳做法
- asp.net – OutOfMemoryException当发送大文件500MB使用Fil
推荐文章
站长推荐
热点阅读
