473,387 Members | 1,760 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,387 software developers and data experts.

Forms authentication page not called

Hello,

I am writing ASP.NET application. I would like to use forms authenication. I
created Login.aspx page and modified Web.config. Start page is Default.aspx.
The problem is that Login.aspx is not called.

Here is part of my Web.config.

<authentication mode="Forms">

<forms name="MIM-Magazyn" loginUrl="Login.aspx" />

</authentication>

<authorization>

<deny users="?"/>

</authorization>

Please help. I have little experience.
I use .NET 2.0.
/RAM/
Oct 9 '07 #1
7 1243
After <system.websection you should declare which users have access to
whish pages.

Anyone should get to the login page so :

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

and no one should get to the default page if not logged in so:

<location path="Default.aspx">
<system.web>
<authorization>
<deny users="?"/>
</authorization>
</system.web>
</location>

You don't need <authorizationtag in <system.websection.

R.A.M. wrote:
Hello,

I am writing ASP.NET application. I would like to use forms authenication. I
created Login.aspx page and modified Web.config. Start page is Default.aspx.
The problem is that Login.aspx is not called.

Here is part of my Web.config.

<authentication mode="Forms">

<forms name="MIM-Magazyn" loginUrl="Login.aspx" />

</authentication>

<authorization>

<deny users="?"/>

</authorization>

Please help. I have little experience.
I use .NET 2.0.
/RAM/

Oct 9 '07 #2
Thanks. Now I have in my Web.config:

....

<location path="Login.aspx">

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

</location>

<location path="Default.aspx">

<system.web><authorization><deny users="?"/></authorization></system.web>

</location>

</configuration>

The problem is that is receive the following compilation error:

<locationsections are allowed only within <configurationsections.
(F:\Inetpub\wwwroot\MIM-Magazyn\web.config line 81) . I don't understand
this message because I added <locationwithin <configuration>.

Could you help me?

/RAM/
Oct 9 '07 #3
I replied earlier but somehow my reply got lost:

Defining locations is not necessary. The original code should work.

Is Login.aspx never called or sometimes it is?

--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"R.A.M." <r_********@poczta.onet.plwrote in message
news:fe**********@news2.task.gda.pl...
Hello,

I am writing ASP.NET application. I would like to use forms authenication.
I created Login.aspx page and modified Web.config. Start page is
Default.aspx. The problem is that Login.aspx is not called.

Here is part of my Web.config.

<authentication mode="Forms">

<forms name="MIM-Magazyn" loginUrl="Login.aspx" />

</authentication>

<authorization>

<deny users="?"/>

</authorization>

Please help. I have little experience.
I use .NET 2.0.
/RAM/

Oct 9 '07 #4
Użytkownik "Eliyahu Goldin" <RE**************************@mMvVpPsS.org>
napisał w wiadomości news:u3****************@TK2MSFTNGP05.phx.gbl...
Is Login.aspx never called or sometimes it is?
Never.
Please help.
/RAM/
Oct 9 '07 #5
Try to change the name parameter in the <forms ...tag. Could be the cookie
MIM-Magazyn became persistent on your machine.

--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"R.A.M." <r_********@poczta.onet.plwrote in message
news:fe**********@news2.task.gda.pl...
Użytkownik "Eliyahu Goldin" <RE**************************@mMvVpPsS.org>
napisał w wiadomości news:u3****************@TK2MSFTNGP05.phx.gbl...
>Is Login.aspx never called or sometimes it is?

Never.
Please help.
/RAM/

Oct 9 '07 #6
Użytkownik "Eliyahu Goldin" <RE**************************@mMvVpPsS.org>
napisał w wiadomości news:uP**************@TK2MSFTNGP03.phx.gbl...
Try to change the name parameter in the <forms ...tag. Could be the
cookie MIM-Magazyn became persistent on your machine.
Thanks.
It helps, but for one time. After one run of application I must change
<forms name=...again to a different string. Do you know what's going on?
/RAM/
Oct 11 '07 #7
By default, the cookie expires after 30 min. If you re-login within 30
minutes, the login form won't pop up. Look at the "timeout" and
"slidingExpiration" attributes of the forms element. They control the
timeout period.

--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"R.A.M." <r_********@poczta.onet.plwrote in message
news:fe**********@news2.task.gda.pl...
Użytkownik "Eliyahu Goldin" <RE**************************@mMvVpPsS.org>
napisał w wiadomości news:uP**************@TK2MSFTNGP03.phx.gbl...
>Try to change the name parameter in the <forms ...tag. Could be the
cookie MIM-Magazyn became persistent on your machine.

Thanks.
It helps, but for one time. After one run of application I must change
<forms name=...again to a different string. Do you know what's going on?
/RAM/

Oct 11 '07 #8

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

Similar topics

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...
3
by: john | last post by:
I have 2 questions: 1. I am trying to use forms authentication. When the user logs out, I make these function calls: Session.Abandon(); FormsAuthentication.SignOut(); But after they log out,...
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...
1
by: Gareth | last post by:
I have an ASP.NET application using forms authentication. I works without any problems. I have been trying to enable the login process to work over SSL but it fails with the same problem...
1
by: Terry Olsen | last post by:
I'm new at VB/ASP.NET. I'm creating a web site that uses authentication. I've got the "create account" and "login" pages working. But how do I make the user data available to all the web pages...
1
by: The Eeediot | last post by:
Hello, ASP.NET gurus! I have read many pages on setting up a login screen to access a number of web pages using Forms Authentication and I am still trying to wrap my brain around the whole thing. ...
3
by: Paul Mason | last post by:
Hi folks, An odd one for the start of this week. I have a web project that I have taken over from a colleague. He had the authentication set to windows, but I have now changed that to forms...
4
by: =?Utf-8?B?RmFyaWJh?= | last post by:
It know that we can use the following method http://msdn2.microsoft.com/en-us/library/eb0zx8fc.aspx to form authenticate across multiple applications. I have created an asp.net application...
4
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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,...

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.