views:

120

answers:

1

I'm writing my first MVC app that uses the membership provider and I noticed that after I login and it is successful - it won't transfer me to the default url (and i can't view any url other than the logon view) so it appears i'm not actually authenticated for some odd reason.

Here is part of the web.config - anything I might be doing wrong here? (using the default MVC account controller - fyi)

   <authentication mode="Forms">
      <forms loginUrl="~/Account.aspx/LogOn" defaultUrl="~/Home.aspx/Index"></forms>
     </authentication>
    <authorization>
      <deny users="*"/>
    </authorization>
+3  A: 

Shouldn't you be denying access to unauthenticated users?

That would look like this

<deny users="?"/>

Also your URL's look interesting. Is ~/Account.aspx/LogOn what you intended?

MikeD
this worked! Huh, I thought the ? would allow anyone for some odd reason. So the * setting I had just blocked everyone regardless? And the ? allows (like you said) only users who are valid through the membership provider? it worked!
Toran Billups
yes, the url works (as I'm using IIS6 and my server admins won't let me do any clean url filtering, i need to add .aspx after the controller)
Toran Billups
Glad that worked. I hear your pain about using MVC with IIS6. Funny how few companies I've worked with have made the move to Windows Server 2008. Maybe they'll move across when the next version comes out ;)
MikeD