我遇到了这个问题,我在代码中改变了de LoginPath,它仍然重定向到"Account/Login"
我代码:app.UseCookieAuthentication(new CookieAuthenticationOptions
{
AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
LoginPath = new PathString("/Acesso/Index"), //bit that I changed
Provider = new CookieAuthenticationProvider
{
// Enables the application to validate the security stamp when the user logs in.
// This is a security feature which is used when you change a password or add an external login to your account.
OnValidateIdentity = SecurityStampValidator.OnValidateIdentity<ApplicationUserManager, Usuario>(
validateInterval: TimeSpan.FromMinutes(30),
regenerateIdentity: (manager, user) => user.GenerateUserIdentityAsync(manager))
}
});
我从VS2013中的默认MVC身份验证应用程序中获取了此代码,这是我发现与未经授权访问后重定向相关的唯一地方。我错过了什么?
检查是否有WebMatrix.dll和/或WebMatrix.Data.dll在您的bin文件夹中,这两个库正在使用simplemember并导致问题。即使这些库没有在任何项目中引用