I just started using ASP.NET MVC 5 (I have used quite a lot of previous versions) and I have a very strange problem: I created a new website using the ASP.NET Visual Studio 2013 template (completely updated). For the template parameters, I chose the MVC template, the authentication type "Individual user accounts", cloud hosting and other components except the main MVC library. After checking the settings, I update all the NuGet packages. And after that I press F5 (without opening or changing any new project files).
The browser only opens to display an error page due to an infinite redirect cycle: URL shows:
http://localhost:24585/Account/Login?ReturnUrl=%2FAccount%2FLogin%3FReturnUrl%3D%252FAccount%252FLogin%253FReturnUrl%253D%25252FAccount%25252FLogin%25253FReturnUrl%25253D%2525252FAccount%252525<snip>
Again, this is with the unmodified ASP.NET MVC pattern. I really checked that the login url is defined in the auth cookie options and this looks good:
// Configure the sign in cookie app.UseCookieAuthentication(new CookieAuthenticationOptions { AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie, LoginPath = new PathString("/Account/Login"), 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, ApplicationUser>( validateInterval: TimeSpan.FromMinutes(30), regenerateIdentity: (manager, user) => user.GenerateUserIdentityAsync(manager)) } });
The only thing that can break the default website is something in the global web.config / machine.config files, although I usually avoid talking to them in my dev block. Running the template without updating the NuGet packages does not solve the problem. There is probably something wrong with the ASP.NET Identity, but I do not know this, and I could not find any relevant information related to my problem.
Question: Does anyone know what the problem is, or at least the best way to fix this problem?
thanks
source share