Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference in Forms Authentication between Razor Preview and Razor Beta?

I'm attempting to upgrade an MVC project to Beta using Razor (from the Preview release) and am now experiencing strangeness with Razor not going to my login view that it use to go to (when someone asks for an action that required authorization).

My web config has

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

But whenever an action with the Authorize attribute is hit, the browser redirects to "Account/Login" - notice Log*in* NOT Log*On*. Anyone know how to fix this in MVC 3 Beta?

like image 645
Jason Haley Avatar asked Dec 10 '22 13:12

Jason Haley


1 Answers

It is a known bug in Beta: Release Notes: Chapter Known Issues

There’s a known issue that causes Forms Authentication to always redirect unauthenticated users to /Account/Login, ignoring the forms authentication setting used in Web.config. The workaround is to add the following app setting.
<add key="autoFormsAuthentication" value="false" />
like image 107
Bcelik Avatar answered Jun 07 '23 03:06

Bcelik