PDA

View Full Version : Login page and the web.config file


andreasberglind
12-24-03, 06:42 PM
I have put all my pages that require login in an "admin" folder in my project. Out side this folder, in the root of the project, I have the default.aspx page, which anyone should be able to reach, and the web.config file.

I have added the code needed to the web.config, and that works fine (Thank you, Shane Bauer...) but it now demands a login for the default.aspx as well.
I have tried adding another web.config inside the admin folder, but that doesn´t seem to work.

What do i need to do to make the root of the project open for anyone, and the contents of the admin folder exclusively for logged in users?

Very thankful for help on this...
and hey, Merry X-mas everyone!

Shane
12-25-03, 01:09 AM
I have put all my pages that require login in an "admin" folder in my project. Out side this folder, in the root of the project, I have the default.aspx page, which anyone should be able to reach, and the web.config file.

I have added the code needed to the web.config, and that works fine (Thank you, Shane Bauer...) but it now demands a login for the default.aspx as well.
I have tried adding another web.config inside the admin folder, but that doesn´t seem to work.

What do i need to do to make the root of the project open for anyone, and the contents of the admin folder exclusively for logged in users?

Very thankful for help on this...
and hey, Merry X-mas everyone!
Can you show me some of your web.config?

andreasberglind
12-25-03, 05:54 AM
Can you show me some of your web.config?

Sure.
These are the only things I have added... What else do i need to do?
This is now placed in the root, should there a web.config inside the admin folder?

<authentication mode="Forms">

<forms name="AuthCookie" path="/" loginUrl="login.aspx" protection="All" timeout="60">
<credentials passwordFormat="Clear">
<user name="user" password="pass" />
</credentials>
</forms>
</authentication>

<authorization>
<deny users="?" />
</authorization>

andreasberglind
12-26-03, 07:40 PM
Solved it!!

All it took was to remove some code from the original web.config, and placing it in a new web.config, placed in the admin folder...