473,405 Members | 2,187 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Usage of Forms Authentication.

Hi, friends,

When we set authentication in web.config file like the follows:

<authentication mode="Forms">
<forms loginUrl="login.aspx" name="myAppCookie" />
</authentication>

we really force a user to access login.aspx first, right?

However, in many cases, we really want to show default.aspx and some other
..aspx to visitors who are not our customers yet. We want them to look at our
web pages before they decide to create an account with us. (With above
setting, a user will have to create a new account before he/she can view any
other pages).

How can I implement this business requirment in asp.net app? Any reference
paper, sample source code?

Thanks a lot for your help.
Nov 19 '05 #1
1 908
Hello Andrew -

There's probably a couple of different ways to do accomplish your goal but
the <location> and <authorization> elements in web.config are your friends.
One way would be to put a link on your login.aspx page to a mydemo directory.
That way when anyone connects to your website, they will be presented with
the login page but anyone could link to the demo directory. In the web.config
you would need to use the <location> element and allow everyone access:

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

Or you can use use the <location> element and to allow access to individual
pages in the default directory:

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

As you can imagine, there's plenty of variations. Check out the following
article for a pretty good overview on form authorization:

http://www.theserverside.net/article...Authentication

--
brians
http://www.limbertech.com
"Andrew" wrote:
Hi, friends,

When we set authentication in web.config file like the follows:

<authentication mode="Forms">
<forms loginUrl="login.aspx" name="myAppCookie" />
</authentication>

we really force a user to access login.aspx first, right?

However, in many cases, we really want to show default.aspx and some other
.aspx to visitors who are not our customers yet. We want them to look at our
web pages before they decide to create an account with us. (With above
setting, a user will have to create a new account before he/she can view any
other pages).

How can I implement this business requirment in asp.net app? Any reference
paper, sample source code?

Thanks a lot for your help.

Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Billy Jacobs | last post by:
I have a website which has both secure and non-secure pages. I want to uses forms authentication. How do I accomplish this? Originally I had my web.config file in the root with Forms...
3
by: Kris van der Mast | last post by:
Hi, I've created a little site for my sports club. In the root folder there are pages that are viewable by every anonymous user but at a certain subfolder my administration pages should be...
1
by: | last post by:
I've got \\root\folder\Page2.aspx that I want to controll access to, by establishing a rule that says "previous URL must be '\\root\folder\Page1.aspx' (which did password validation). The code...
2
by: Eric | last post by:
I am trying to build an app where the stuff in the root directory is open to all, but anything under the Restricted directory requires you to login and I want to use Forms to do it. I'm having...
0
by: Anonieko Ramos | last post by:
ASP.NET Forms Authentication Best Practices Dr. Dobb's Journal February 2004 Protecting user information is critical By Douglas Reilly Douglas is the author of Designing Microsoft ASP.NET...
7
by: Justin | last post by:
I am trying to password protect a subdirectory using forms authentication. I am using the "Location" tag to specify the directory to be protected. The login.aspx page is in the root directory of...
5
by: V. Jenks | last post by:
Using forms authentication, can I control which pages and/or directories a user would have access to or is that only available with Windows authentication? Thanks!
4
by: =?Utf-8?B?R3V1czEyMw==?= | last post by:
Hi, I created a web site on a remote server. To logon the user must enter a user id and password. The site is uses Forms Authentication. The web config file looks as follows: ...
5
by: Rory Becker | last post by:
Having now created a Custom MembershipProvider that seems to work correctly with my Logon and ChangePassword controls, I am, as they say, a happy bunny. The next stange is to move on to the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.