[thelist] ASP.NET: Forms-Based Authentication (thank you Gary)

Gary McPherson lists at ingenyus.net
Tue Oct 12 13:05:16 CDT 2004


----Original Message----
From: thelist-bounces at lists.evolt.org
[mailto:thelist-bounces at lists.evolt.org] On Behalf Of Casey Crookston
Sent: 12 October 2004 16:28
To: thelist at lists.evolt.org
Subject: [thelist] ASP.NET: Forms-Based Authentication (thank
you Gary)

> Thanks, Gary, for pointing me to this article.  It has helped tons.
> 
> http://samples.gotdotnet.com/quickstart/aspplus/doc/formsauth.aspx
> 
> Next question.  The site I am working on does not need
> authentication on all pages, only three of the seven.  When I
> implement this form of authentication, it protects the entire
> site.  The default.aspx page, and 6 others, needs to be
> public.  How can I indicate which pages need to be secured?
> 
> Thanks,
> 
> Casey

Contrary to the previous reply, you CAN set up page-specific authentication,
although it is a lot easier to keep all your protected files in a single
directory as suggested.

However, if you really do need to specify page-level settings, open the
web.config file in your directory and set it up for the settings that apply
to the majority of those pages - in this case, for public access. After the
</system.web> tag, add this code for each page you want to configure:

<location path="pagename.aspx">
	<system.web>
		<authorization>
			<allow users="?"/>
		</authorization>
	</system.web>
</location>

Hope that helps,

Gary




More information about the thelist mailing list