1

So I've got (below) in my web.config. But everything other than my very default page gets redirected to login.aspx. Everything in /Content/, and any other page.

<authentication mode="Forms"/>
<authorization>
  <allow users="*"/>
</authorization>

I have no idea what's going on. Works locally without a hitch. Blows up on the server.

tereško
  • 58,060
  • 25
  • 98
  • 150
TylerJPresley
  • 490
  • 4
  • 14
  • Are you authenticating correctly (Actually supplying the correct credentials)? Is your routing setup correctly? Use FIDDLER2 to check after you've logged on to see if it attempting to send anywhere other than login.aspx – Darren Apr 12 '12 at 15:34
  • Don't use the authorization tags in the web.config. Use the `[Authorize]` attribute on your controllers/actions. – ZippyV Apr 13 '12 at 07:24

2 Answers2

0

Which controller is your default page being served from? I assume /Home/Index.

Take a look at your other controllers and see if for some reason you have put the [Authorize] attribute on the class or any of its methods.

If so, the user must have a forms authentication ticket to view the content of those Controllers/Actions.

You can remove the [Authorize] attribute to give open access or you need to implement forms authentication.

Brett Allred
  • 3,459
  • 26
  • 30
  • [Authorize] hasn't been used anywhere. It's not the pages that's the problem. Everything I get auth errors on everything else. Like authentication never gets set. – TylerJPresley Apr 12 '12 at 18:14
0

It works locally but when you deploy it fails? If so check this response.

ASP.NET MVC3 and Windows Auth on IIS keeps redirecting to /Account/Login

It is about WebMatrix.Data.dll and WebMatrix.WebData.dll. Those 2 files should NOT accompany the deployment. Those two force the login.aspx redirect it seems.

Community
  • 1
  • 1
Wolf5
  • 16,600
  • 12
  • 59
  • 58