473,763 Members | 1,893 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem with web.config inheritance and <authorizatio n> section

Hi,

I have the following tags in my root web.config file:

<authorizatio n>
<allow roles="RoleA,Ro leB"/>
<deny users="*"/>
</authorization>

I also have a public folder in my application called "~/Public"

I like to put all publicly available aspx pages in the "~/Public" folder.
Here is what I have in the web.config file within "~/Public" folder:

<?xml version="1.0"?>
<configuratio n>
<appSettings/>
<connectionStri ngs/>
<system.web>
<authorizatio n>
<allow users="*"/>
</authorization>
</system.web>
</configuration>
The problem is that none of pages in "~/Public" folder are available for
public users. I guess still thetag <deny users="*"/in root web.config is
in effect.

How can I make the pages within "~/Public" folder available for anonymous
users?

Any help would be appreciated,
Max

Jul 13 '07 #1
4 5345
Hi Max,

Have you got the problem resolved? Based on my understanding, using a
web.config file in sub directory does be identical to using a <location>
section in root web.config. Also, I've performed some simple local test
and the public pages(in a sub folder mark with <allow users="*" / should
be visible to all users no matter how you configure authorization setting
in root web.config file. I think there maybe something else result to your
application's problem behavior.

You can also try a simple forms authentication application to see whether
you can duplicate the same issue.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.

Jul 16 '07 #2
It certainly seems like the root authorization takes precedence - I too have
a web config with
<authorizatio n>
<deny users="?" />
<allow users="*" />
</authorization>

and then

<!-- Allow public access to all files in the public folder-->
<location path="Public">
<system.web>
<authorizatio n>
<allow users="*" />
</authorization>
</system.web>
</location>

None-the-less, I get a login form for pages in Public.

Removing the deny from the global authorization allows public access to the
pages in the Public folder, but also to pages in the root directory.
Jul 16 '07 #3
Hi Quincy,

Thanks for your input.

Seems my test result is quite different. I've tried both approaches(usin g a
web.config file in sub folder and using the <locationelemen t to specify
sub folder setting), and in b oth cases, sub folder's authorization rules
will take precedence. And this is also the expected behavior. If you feel
necessary, I can send a test project to you.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.

Jul 17 '07 #4
Hi Max,

Any progress on this issue? If you still have any questions on this, please
feel free to post here.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

This posting is provided "AS IS" with no warranties, and confers no rights.

Jul 19 '07 #5

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

Similar topics

2
1995
by: phreeskier | last post by:
i want to implement authorization with windows authentication and don't have the slightest clue of how to do this implementation. the basic windows authentication for this .NET application is already setup. my problem lies within my inability to manipulate the username captured in the authentication process and my knowledge of how IIS is involved. specifically, i have the following questions: 1) what object(s) can be used so that the...
0
951
by: Tampa .NET Koder | last post by:
I want to protect several folders in my application. However, in each folder I want to specify a different login page for each section. It seems like you can only define 1 login page in the web.config file at the root of the application. Is there any way around this?
9
2748
by: Bijoy Naick | last post by:
I've implemented forms authentication and authorization on my application. In my Web.Config, my authorization section looks like this.. <authorization> <allow roles="admin" /> <deny users="*" /> </authorization> If an authenticated user, who is NOT designated the role "admin" attempts to access this folder, he/she is simply redirected to the login page.
2
1333
by: lenyado | last post by:
i want to use the forms authentication for the folder in virtual folder "admin/" but i don't know how to config the web.config. once i turn on authentication mode to "Forms", all files will need authenticate, which is not what i want. anyone can help?
2
1134
by: sduncansca | last post by:
Hi I have an ASP.NET v1.4 application that uses form based authorization. My authorization section of the web.config looks like <authorization> <deny users="?" /> <allow users="*" /> </authorization> Whenever I tried to open the project using VS 2003 it generates a ASP.NET
6
1897
by: Scatir | last post by:
Hi, I have a membership problem I couldn't resolve. I have set up membership as most of tutorial instructed, and I am able to log on, but cannot stay log on for some reason. ex: when I log on, the log in become log on, but when I access the protected page, it still prompt me for log in. Please help! I am using SQL to store the membership, the code in web.config is as follow, <roleManager enabled="true"/>
0
1259
by: yofnik | last post by:
Hello, Using policy (modifying web.config) and FormsAuthentication, is it possible to return an error message (or redirect to error page) instead of redirecting to the login page for specific users only? Here's an example: I have a section of my web app that is for admins only. The authorization section of my web.config looks like.
0
999
by: stevek | last post by:
I have a site which I want anonymous access to, but want to restrict access by role to particular subfolders. I've tried to do this many ways in web.config, but they have all resulted in members who don't belong to any role being able to access the restricted subfolders. I know how to do this in code, but I'd rather do it in web.config. I believe the comments in "Step 3" in the article http://www.devx.com/dotnet/Article/32223/0/page/2 have...
0
2043
by: ronscottlangham | last post by:
I have a web page that any authenticated user can access, but I dynamically enable/disable other asp.net controls on the web page based on the Role that they are in via C# code behind. My web config is as follows... <system.web> <authorization> <deny users="?" /> </authorization>
0
9389
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10149
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9943
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7370
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6643
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5271
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5410
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3918
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2797
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.