authentication

  • Thread starter Thread starter Ivan A. Gavrilyuk
  • Start date Start date
I

Ivan A. Gavrilyuk

Hi.

How can I use authentication (forms) only for some pages on my web site. For
example I do not want to users enter login/password for start page etc.

Thanks.
 
Hi Ivan,

The best method of accomplishing this is via <location> elements in the
web.config. For example, I have an external Web application with protected
Web forms. All of the Web forms that are protected in are in a /members
folder. Here's an excerpt of the machine.config that configures this:

<system.web>
<authentication mode="Forms">
<forms name=".myApp" loginUrl="login.aspx" protection="All"
timeout="30" path="/" />
</authentication>
<authorization>
<allow users="*"/>
</authorization>
</system.web>

<location path="members">
<system.web>
<authorization>
<deny users="?"/>
<allow users="*"/>
</authorization>
</system.web>
</location>


In this case, I've specified "members" for the path attribute of the
<location> element, but you don't have to use a folder. You can also
specify a particular file. You can also have more than one <location>
element in your web.config file.

Hope that helps.

Jim Cheshire, MCSE, MCSD [MSFT]
ASP.NET
Developer Support
(e-mail address removed)

This post is provided "AS-IS" with no warranties and confers no rights.

--------------------
 
Back
Top