-
Authentication help
Hey there,
I've been using authentication and authorisation in web pages for a while,,, except I never really had much of a need to make it more advanced. Atm I just have it so it blocks everyone out of the whole site and redirects them to the login page, then they have free roam to everyhting else.
What I would like to know is, is there any tutorials out there or anything that goes in to this in more of an advanced manner?
In the end I would like to have users view half the site without needing a login,, and then certain users with a login to view some sections and other users differnt sections..
any advice would be greatly appreciated,, thanx in advance
-
Re: Authentication help
You can use the web.config to change which area's of your site are available to anonymous users etc.
Code:
<!-- Will not allow un-authenticated users to access a folder called restricted in your web app -->
<location path="restricted">
<system.web>
<authorization>
<deny users="?"/>
</authorization>
</system.web>
</location>
<!-- Will allow anyone to access a folder called registration -->
<location path="registration">
<system.web>
<authorization>
<allow users="?"/>
</authorization>
</system.web>
</location>
That would be a simple way of seperating your site but you can also look into using roles.
-
Re: Authentication help
You don't get tutorials for these things, it's more of a combination of logic/common sense which you use to make it work the way you want.