Tutorial :How to use the deny all with membership provider and MVC



Question:

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>  


Solution:1

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?


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »