Forms Authentication - Supress displaying the login page for certain web pages

F

Felix Wafytech

Hi All,

I'm using forms authentication. Opening any page would lead to the login
page if the user is not currently logged in. This is fine. But I would like
certain public pages to be displayed irrespective of whether the user has
logged in or not. Is there a way to stop the authentication mechanism for
public pages without changing the directory in which it exists?

Note: I'm using a master page and changing the directory would lead to
images not appearing due to the change in directory.

If this isn't possible, then the only solution I see is to create a new
master page and place the file in a different directory. Is this the only
option?

Thanks in advance,
Felix.J
 
D

Dominick Baier

use a <location path="publicPage.aspx"> element and set the autorization
settings for individual files or folders..
 
S

Steven Cheng[MSFT]

Thanks for Dominick's informative suggestion.

Hi Felix,

As Dominick has suggested, you can use the <location> element to grant
specific <authorization> setting for individual pages or directories in the
ASP.NET web application.

#How to: Configure Specific Directories Using Location Settings
http://msdn2.microsoft.com/en-us/library/ms178692.aspx

For example, the following configuration sections customize the application
to allow anomymous(unauthenticated) user to access the "ContactUS.aspx"
page and the "PublicUsers" sub directory under the application root dir:

==============================

<configuration >

<location path="ContactUS.aspx">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>

<location path="PublicUsers">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>
....................
==============================

If there is anything unclear or any other information you need, please feel
free to post here.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead



==================================================

Get notification to my posts through email? Please refer to

http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.



Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial

response from the community or a Microsoft Support Engineer within 1
business day is

acceptable. Please note that each follow up response may take approximately
2 business days

as the support professional working with you may need further investigation
to reach the

most efficient resolution. The offering is not appropriate for situations
that require

urgent, real-time or phone-based interactions or complex project analysis
and dump analysis

issues. Issues of this nature are best handled working with a dedicated
Microsoft Support

Engineer by contacting Microsoft Customer Support Services (CSS) at

http://msdn.microsoft.com/subscriptions/support/default.aspx.

==================================================



This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,025
Latest member
KetoRushACVFitness

Latest Threads

Top