Web config security settings

K

Kazim Kargi

Hi all;
I want to use user name and password in my asp.net project
for all aspx files but not for asmx files. Or i want to
use some files with user name but some another not
In web config my configuration is;
authentication mode="Forms">
<forms loginUrl="tom/ortak/LoginPage.aspx"
protection="All" path="/tom/"/>
</authentication>

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

I want some files not to ask user name/ pass while other
project files ask on same time. How can i do?

Thanks for your help...
 
T

Teemu Keiski

In the same web.config (that means also files in the same application)
specify a <location> tag (inside <configuration> outside <system.web>) that
points to the file. Inside it specify differentiating authorization details.

....
</system.web>
<location path="publicpage.aspx">
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
</location>
....
</configuration>

If you need to protect other content than normal ASP.NET stuff like aspx,
asmx etc, you need to map that file extension in IIS for ASP.NET's ISAPI dll
so those files are served by ASp.NET (that they are *not* by default)

--
Teemu Keiski
MCP, Designer/Developer
Mansoft tietotekniikka Oy
http://www.mansoft.fi

AspInsiders Member, www.aspinsiders.com
ASP.NET Forums Moderator, www.asp.net
AspAlliance Columnist, www.aspalliance.com
 

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

Staff online

Members online

Forum statistics

Threads
473,769
Messages
2,569,577
Members
45,054
Latest member
LucyCarper

Latest Threads

Top