Try to restrict acces to all my pages.

J

Jensen bredal

Hello,
I'm trying to protect my pages by allowing only authenticated users to view
them.
I have therefore taken the following action in web.config:
<authentication mode="Forms">

<forms name=".Mycookiename" loginUrl="Login.aspx" protection="All"
timeout="30" path="/">

</forms>

</authentication>

---

---

---



<authorization>

<allow users="?" /> <!-- Allow all users -->



</authorization>



But when i attempt to view any page in my virtual directory,

i'm not redirected to the login page. What i'm i doing wrong?

Many thanks in advance

JB
 
G

Guest

hey Jensen,

try this and replace the user credentials with your user credentials

<authentication mode="Forms" > <!-- Set authentication mode -->
<forms loginUrl="LogIn.aspx" > <!-- Specify a log on form -->
<credentials passwordFormat="Clear"> <!-- Create a user list -->
<user name="Jensen" password="JensenPassword"/>
</credentials>
</forms>
</authentication>

<authorization>
<deny users="?" /> <!—Deny all unauthenticated users -->
</authorization>


Note :- dont forget too add this tag or else it wont be redirected to the
login page
<forms loginUrl="LogIn.aspx" > <!-- Specify a log on form -->


********************************
Hope this helps,

Shaun
http://blogs.wwwcoder.com/shaunakp
********************************
 

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

Forum statistics

Threads
473,968
Messages
2,570,153
Members
46,699
Latest member
AnneRosen

Latest Threads

Top