473,420 Members | 4,459 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,420 software developers and data experts.

Web.config Authorization Help

I have a web app where one page should be publicly accessable and another
restricted to a certain local group (integrated windows auth)

How can I do this in a web.config? Can I specify different authorization
settings per file? per folder? (i.e. create an /admin folder for private
content?)

TIA,
Craig
Nov 18 '05 #1
3 10975
Hi,

you can set different authorizations at file and at folder level by using
<location> tag. it is put outside the <system.web> element of the web.config
(if you put it on the same general root web.config file)
<configuration>
....
<!-- Normal config here //-->
<system.web>
....
</system.web>
<!-- Page-specific setting here //-->
<location path="page.aspx">
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
</location>
</configuration>

This for example grants access for 'page.aspx' for all users despite are
they authenticated or not. If you need to set it for a folder, just replace
the page name with the folder name.

--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist

"Craig" <cs******@remoovdis.kc.rr.com> wrote in message
news:OV**************@TK2MSFTNGP10.phx.gbl...
I have a web app where one page should be publicly accessable and another
restricted to a certain local group (integrated windows auth)

How can I do this in a web.config? Can I specify different authorization
settings per file? per folder? (i.e. create an /admin folder for private
content?)

TIA,
Craig

Nov 18 '05 #2
Hi,

you can set different authorizations at file and at folder level by using
<location> tag. it is put outside the <system.web> element of the web.config
(if you put it on the same general root web.config file)
<configuration>
....
<!-- Normal config here //-->
<system.web>
....
</system.web>
<!-- Page-specific setting here //-->
<location path="page.aspx">
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
</location>
</configuration>

This for example grants access for 'page.aspx' for all users despite are
they authenticated or not. If you need to set it for a folder, just replace
the page name with the folder name.

--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist

"Craig" <cs******@remoovdis.kc.rr.com> wrote in message
news:OV**************@TK2MSFTNGP10.phx.gbl...
I have a web app where one page should be publicly accessable and another
restricted to a certain local group (integrated windows auth)

How can I do this in a web.config? Can I specify different authorization
settings per file? per folder? (i.e. create an /admin folder for private
content?)

TIA,
Craig

Nov 18 '05 #3
Perfect! Thanks for the help...

"Teemu Keiski" <jo****@aspalliance.com> wrote in message
news:uw**************@tk2msftngp13.phx.gbl...
Hi,

you can set different authorizations at file and at folder level by using
<location> tag. it is put outside the <system.web> element of the web.config (if you put it on the same general root web.config file)
<configuration>
...
<!-- Normal config here //-->
<system.web>
...
</system.web>
<!-- Page-specific setting here //-->
<location path="page.aspx">
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
</location>
</configuration>

This for example grants access for 'page.aspx' for all users despite are
they authenticated or not. If you need to set it for a folder, just replace the page name with the folder name.

--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist

"Craig" <cs******@remoovdis.kc.rr.com> wrote in message
news:OV**************@TK2MSFTNGP10.phx.gbl...
I have a web app where one page should be publicly accessable and another
restricted to a certain local group (integrated windows auth)

How can I do this in a web.config? Can I specify different authorization settings per file? per folder? (i.e. create an /admin folder for private content?)

TIA,
Craig


Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Narendra | last post by:
Hi All: I am trying to create a web application where there are two directories. One directory named Templates which will serve the pages to Users and other directory called Admin which will have...
4
by: tommy | last post by:
hello everbody, i write a little asp-application with forms-authentication. i copy my aspx-files with web.config to my webspace and i get the error above... i tried to set the...
0
by: Adam Getchell | last post by:
I'm attempting to write a custom Authentication module using http://www.15seconds.com/Issue/020417.htm I looked at http://support.microsoft.com/default.aspx?scid=kb;EN-US;307996, but it doesn't...
7
by: Matthias S. | last post by:
Hi, here is what I'm trying to do: I have a virtual directory called "WebApp". Under this one I've got 2 physical directories called "Customers" and "Admins". I implemented Forms-based...
9
by: Benny Ng | last post by:
Hi,all, How to let the sub-directory to avoid the authentication control from Root's webconfig? I heard that we can add a new web.config to the sub-directory. And then we can slove the problem....
5
by: Andrew | last post by:
Hi, I have a default.aspx which allows the user to choose between module Admin and module B. When the user clicks either one, he will be redirected to a FormsAuthentication login page. The...
0
by: ktummala | last post by:
Hi All: I need help creating a web.config which will disable the authorization for my web services and will enable the authorization to all other kinds of files (.aspx,.cs,..etc..). For...
1
by: Chang Lui | last post by:
This might be a stupid question - but is there any way to store authorization infomation (allow users="" deny users="") somewhere other then a web.config file. We have a very large site with many...
4
by: Max2006 | last post by:
Hi, I have the following tags in my root web.config file: <authorization> <allow roles="RoleA,RoleB"/> <deny users="*"/> </authorization> I also have a public folder in my application...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.