24255

Automatic redirection of FormsAuthentication to other URL than specified in the Web.Config?

I have this section in the Web.config for my MVC3 application:

<authentication mode="Forms"> <forms loginUrl="~/Account/LogOn" timeout="20" slidingExpiration="true"/> </authentication>

Until recently every time the code hit an [Authorize] attribute the LogOn.cshtml page was shown. All of a sudden the redirection takes place to Account/Login (not the 'i' instead of the 'O'!!!) and I get a resource not found exception. I did a Find on the Web.config and could not find the word 'login' anywhere! What on Earh can have gone wrong?

Answer1:

This is a known issue with ASP.NET MVC 3 as stated in the release notes. To solve it simply add the following to the <appSettings> node of your web.config:

<appSettings> <add key="loginUrl" value="~/Account/LogOn" /> <appSettings>

or try with the following key as suggested by the release notes:

<add key="autoFormsAuthentication" value="false" />

Recommend

  • forms authentication persistent across multiple servers
  • IdentityServer4 cookie expiration
  • How to do Single Sign On for multiple MVC 4 web applications on IIS 7.5
  • Create app service call executing multiple times
  • In Rails, why there is a new Gemfile.lock when no bundle or bundle install was run? (and a new Gemfi
  • Getting 403: Forbidden: Access is Denied when users closes logged in session accidentally
  • Border Layout not working
  • Payum Bundle : How to change the view of capture action in symfony2
  • How to fetch the file list from gcs?
  • Jquery javascript: have a filtering list(works), need help keeping all LI's visible when there&
  • request follow redirection without post data
  • Error when trying to send an email using Gmail API in Java
  • Office365 authentication without login redirection
  • Javascript unload page condition
  • Create registry key in 32-bit hive on x64 PC using Installshield 2012 LE - Avoid redirection
  • How do you keep a running instance for Google App Engine
  • WordPress > setting permalink option via script buggy?
  • How to create two column output from a single column
  • How can I get the choice “H2” back in the H2 consol?
  • Approximate Order-Preserving Huffman Code
  • Cannot upload to OneDrive using the new SDK
  • Debugging ASP.NET on a built-in web server suddenly stops
  • Ajax jQuery multiple calls at the same time - long wait for answer and not able to cancel
  • Different response to non-authenticated users and AJAX calls
  • How to recover from a Spring Social ExpiredAuthorizationException
  • Does CUDA 5 support STL or THRUST inside the device code?
  • Hazelcast - OperationTimeoutException
  • File upload with ng-file-upload throwing error
  • Benchmarking RAM performance - UWP and C#
  • Acquiring multiple attributes from .xml file in c#
  • Why can't I rebase on to an ancestor of source changesets if on a different branch?
  • How to CLICK on IE download dialog box i.e.(Open, Save, Save As…)
  • Can Visual Studio XAML designer handle font family names with spaces as a resource?
  • How can I remove ASP.NET Designer.cs files?
  • Are Kotlin's Float, Int etc optimised to built-in types in the JVM? [duplicate]
  • sending mail using smtp is too slow
  • Busy indicator not showing up in wpf window [duplicate]
  • Why is Django giving me: 'first_name' is an invalid keyword argument for this function?
  • How can I use `wmic` in a Windows PE script?
  • java string with new operator and a literal