using <location> with <authorization>

E

Erik Sargent

I need help with specifics of using <location> with <authorization>.

I started with
http://msdn.microsoft.com/library/d.../html/cpconaspnetauthorization.asp?frame=true
At the bottom of the page, there is a cryptic reference to the "<location>"
tag - but no explaination of how to use it.

I found
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetsec/html/SecNetch08.asp
which explains it better, but there is also, the KB article
http://support.microsoft.com/default.aspx?scid=kb;en-us;316871 which suggests
that the <system.web> section is INSIDE the <location> tag, which doesn't
seem to be right, but since I can't get it to work I can't say for sure.

I currently have:

<configuration>
--- some other stuff ---
<authentication mode="Windows" />
<authorization>
<allow roles="group1, group2"/>
<deny users="?" />
</authorization>
<location path="error.aspx">
<authorization>
<allow users ="*" />
</authorization>
</location>

<location path="CreateReciept.asmx">
<authorization>
<allow users ="?" />
</authorization>
</location>

I am aware that '*' and '?' are different - I've been experimenting. I also
tried adding a <system.web> tag outside the main body and putting the special
location tags there, which is more what the KB article (above) indicates.

I'd like to see an example, including specifically an example of setting
certain Windows groups for access to the site generally, but anonymous access
for special pages, such as an error page and the web service. The current
behavior is to require membership in one of the listed groups in order to
access any of the site, including the pages that I've attempted to override
the settings for.
 
P

Paul Glavich [MVP ASP.NET]

You can use the standard :-

<configuration>
<system.web>
......
</system.web>
</configuration>

but you can also have the <location> element within the <configuration>
element, and the <location> element also contains another <system.web>
series of elements so....

<configuration>
<system.web>
......
</system.web>
<location path="somefileorDir.aspx">
<system.web>
.........
</system.web>
</location>
</configuration>

--

- Paul Glavich
ASP.NET MVP
ASPInsider (www.aspinsiders.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

Members online

Forum statistics

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

Latest Threads

Top