Difference in form authentication between razor preview and razor razor?

I am trying to upgrade an MVC project to beta using Razor (from the preview version), and now I feel weird with Razor not going to my login window, which it uses to go to (when someone asks for the required authorization action).

In my web configuration there is

<authentication mode="Forms"> <forms loginUrl="~/Account/LogOn" timeout="2880" /> </authentication> 

But whenever an action with the Authorize attribute hits, the browser is redirected to "Account / Login" - a notification of registration in * NOT Log * On *. Does anyone know how to fix this in the beta version of MVC 3?

+4
source share
3 answers

This is a known beta bug: Release Notes: Known Issues

Theres a known issue where Autodesk Forms Authentication always redirects unauthorized users to / Account / Login, ignoring the form validation settings used in Web.config. The workaround is to add the following application settings.
 <add key="autoFormsAuthentication" value="false" /> 
+10
source

Try adding the following <configuration> section of your Web.config file application:

 <appSettings> <add key="enableSimpleMembership" value="false" /> </appSettings> 
+3
source

All you need to do is disable authentication mode="Forms" .

I deleted the authentication section and started working.

 <!-- <authentication mode="Forms"> <forms loginUrl="~/Account/LogOn" timeout="2880" /> </authentication> --> 
+1
source

All Articles