newbie: What am I missing here?

J

Jeff

Hey

asp.net 2.0

I'm trying to learn asp.net 2.0 authentication so I created a simple website
project. My problem is that I want the SecTest.aspx (SecTest = Security
Test) to be impossible to view for unauthenticated users. As my settings are
now, if the user is unauthenticated and clicks on the menu item "Test", then
the user is direted to SecTest.aspx.
web.sitemap:
<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
<siteMapNode url="Default.aspx" title="Home" description="">
<siteMapNode url="~/SecTest.aspx" title="Test" description="" >
</siteMapNode>
.... more sitemap nodes

web.config:
<authentication mode="Forms">
<forms cookieless="AutoDetect"
loginUrl="~/AccessDenied.aspx"
name="TBHFORMAUTH" />
</authentication>

I thought that by using the "LoginUrl", it would be impossible to access the
SecTest.aspx page for unauthenticated users, the user should be redirected
to the AccessDenied.aspx webpage instead

Any idea what I'm missing here?
 
G

Guest

Hi,
you are missing the below section
<authorization>
<deny users="?"/>
</authorization>

Regards,
Mohamed Mosalem
 

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,152
Members
46,698
Latest member
LydiaHalle

Latest Threads

Top