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

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top