473,508 Members | 2,233 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Forms authentication

Hi all

How can the following problem be solved:

My application uses forms authentication. Normally a
start.aspx page should be send to the client before
login.aspx is shown.
Start.aspx consist of simple JScript writing a cookie about
screen resolution followed by an automatic transfer to
login.aspx. This page is therefore test whether cookies and
JScript are activated.

But if forms authentication is activated, the only
accessible page is login.aspx. So I need first to login and
therefore set the authentication cookie in order to access
start.aspx (checking whether cookie are activated.... :-) ).
My webconfig is:

<authentication mode="Forms" >
<forms
name="Auth-Cookie"
path="\"
loginUrl="Login.aspx"
protection="All"
timeout="25">
<credentials passwordFormat="Clear">
<user name="Test" password="Pass" />
</credentials>
</forms>
</authentication>
<authorization>
<deny users="?" />
</authorization>

The deny setting prevent unathorized user from accessing
start.aspx. But this is necessary to make the cookie and
jscript check!

Each help appreciated!

Thanks
Jenny
Nov 17 '05 #1
2 2524
Jenny,
You can overrride specific allow/deny permissions for individual pages and
directories.

What you have already defined in the <authorization> tag of <system.web>
will be applied to all pages that do not have any of their own setting
defined.
To override that setting for a specific page, in your case start.aspx, just
place the following code in your web.config file:
<configuration>
....
<system.web>
....
</system.web>

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

</configuration>

note that this is contained in the <configuation> tag, but after the ending
</system.web> tag.

that code will allow everyone, authenticated or not, to access start.aspx.

HTH,
-Cliff

"Jenny" <j.********@SPAMx-mail.net> wrote in message
news:09****************************@phx.gbl...
Hi all

How can the following problem be solved:

My application uses forms authentication. Normally a
start.aspx page should be send to the client before
login.aspx is shown.
Start.aspx consist of simple JScript writing a cookie about
screen resolution followed by an automatic transfer to
login.aspx. This page is therefore test whether cookies and
JScript are activated.

But if forms authentication is activated, the only
accessible page is login.aspx. So I need first to login and
therefore set the authentication cookie in order to access
start.aspx (checking whether cookie are activated.... :-) ).
My webconfig is:

<authentication mode="Forms" >
<forms
name="Auth-Cookie"
path="\"
loginUrl="Login.aspx"
protection="All"
timeout="25">
<credentials passwordFormat="Clear">
<user name="Test" password="Pass" />
</credentials>
</forms>
</authentication>
<authorization>
<deny users="?" />
</authorization>

The deny setting prevent unathorized user from accessing
start.aspx. But this is necessary to make the cookie and
jscript check!

Each help appreciated!

Thanks
Jenny

Nov 17 '05 #2
Hi There...

I am getting this wierd error when i am adding location tags in my
web.config.

"System.exception: there is more than one system.web section in your
configuration file"

Does anyone know why its happening. I am using WSE 1.0 SP1, i have
tried reinstalling it, but no good yet.

Any assistance will be highly appreciated.
Thanx.

Reeya.

"Cliff Harris" <he***@myrealbox.com> wrote in message news:<e6**************@TK2MSFTNGP11.phx.gbl>...
Jenny,
You can overrride specific allow/deny permissions for individual pages and
directories.

What you have already defined in the <authorization> tag of <system.web>
will be applied to all pages that do not have any of their own setting
defined.
To override that setting for a specific page, in your case start.aspx, just
place the following code in your web.config file:
<configuration>
...
<system.web>
...
</system.web>

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

</configuration>

note that this is contained in the <configuation> tag, but after the ending
</system.web> tag.

that code will allow everyone, authenticated or not, to access start.aspx.

HTH,
-Cliff

"Jenny" <j.********@SPAMx-mail.net> wrote in message
news:09****************************@phx.gbl...
Hi all

How can the following problem be solved:

My application uses forms authentication. Normally a
start.aspx page should be send to the client before
login.aspx is shown.
Start.aspx consist of simple JScript writing a cookie about
screen resolution followed by an automatic transfer to
login.aspx. This page is therefore test whether cookies and
JScript are activated.

But if forms authentication is activated, the only
accessible page is login.aspx. So I need first to login and
therefore set the authentication cookie in order to access
start.aspx (checking whether cookie are activated.... :-) ).
My webconfig is:

<authentication mode="Forms" >
<forms
name="Auth-Cookie"
path="\"
loginUrl="Login.aspx"
protection="All"
timeout="25">
<credentials passwordFormat="Clear">
<user name="Test" password="Pass" />
</credentials>
</forms>
</authentication>
<authorization>
<deny users="?" />
</authorization>

The deny setting prevent unathorized user from accessing
start.aspx. But this is necessary to make the cookie and
jscript check!

Each help appreciated!

Thanks
Jenny

Nov 17 '05 #3

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

Similar topics

6
4797
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
4837
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...
2
2482
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
4199
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
2021
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
1653
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
424
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: ...
4
5314
by: Bjorn Sagbakken | last post by:
In a web-application with login creds (user, pwd), these are checked against a user table on a SQL server. On a positive validation I have saved the userID, name, custno and role-settings in a...
5
3531
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...
1
2561
by: Sean | last post by:
Hi, I've taken over a website, which has an admin section that is currently open. I added Forms Authentication to the admin directory with the using the location section in web.config: ...
0
7225
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
7123
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...
1
7046
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
5627
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,...
1
5053
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...
0
4707
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3182
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
766
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
418
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.