我正在使用Visual Studio 2013从互联网上学习MVC.
完成我的项目并通过"发布"将其部署到主机后,它完美地工作(本地也是如此).
虽然现在,该应用程序在登录时(发布后)抛出一个身份验证表单.在本地它不会这样做.我想完全删除authintication,因为该网站(及其所有页面)都是打开的.
我很抱歉这个沉闷的问题,但是我搜索并且无法准确找到关于我的问题的线索,可能是由于框架的那一侧完全无知......请帮忙.
我试图手动追踪事物,我有一个"startup.cs",其中包含:
public partial class Startup
{
public void Configuration(IAppBuilder app)
{
ConfigureAuth(app);
}
}
Run Code Online (Sandbox Code Playgroud)
这会将我引导到文件"Startup.Auth",该文件自动具有:
public void ConfigureAuth(IAppBuilder app)
{
// 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);
...
Run Code Online (Sandbox Code Playgroud)
当尝试在Startup.cs中删除函数调用时,项目会立即抛出一个非常基本的登录菜单.
然后,在我的项目设置中,我保持"Windows身份验证"和"匿名身份验证"禁用.保持"Startup.cs"中的函数调用.
但在那种情况下它抛出"这个页面有一个重定向循环"..
请帮助我,我对此非常困惑:我想完全删除身份验证.
检查您的 web.config 中是否设置了 None 模式
<system.web>
<authentication mode="None" />
</system.web>
Run Code Online (Sandbox Code Playgroud)
最终Web.Release.config