Ask a Question related to ASP.NET Security, Design and Development.
-
Ryan Taylor #1
Location element in the Web.config file. Allow System Admin whole directory, allow others specific page
Hello.
I am developing an ASP.net C# application using forms authentication. I have
a directory ManageUsers and I want all pages in that directory to be
accessed by the system administrator. But, there is one page,
ChangePassword.aspx that any authenticated user should be able to access.
How exactly does the location element assign permissions to directories and
pages? I thought that permissions would be applied in the order that the
location elements were defined in the web.config file. With the latest
location element defining the permissions.
The following is what I have attempted. But when the Change Password role is
assigned to the user, he/she is able to view all pages in the ManageUsers
directory and not just the ManageUsers/ChangePassword.aspx
<location path="ManageUsers" allowOverride="false">
<system.web>
<authorization>
<allow roles="System Administrator, Requesting Organization
Administrator, Responding Organization Administrator" />
<deny users="?" />
</authorization>
</system.web>
</location>
<location path="ManageUsers/ChangePassword.aspx" allowOverride="false">
<system.web>
<authorization>
<allow roles="Change Password, System Administrator, Requesting
Organization Administrator, Requesting Organization User, Responding
Organization Administrator, Responding Organization User" />
<deny users="?" />
</authorization>
</system.web>
</location>
Thanks in advance for any assistance.
Ryan Taylor
Ryan Taylor Guest
-
How to limit access to admin subfolder using web.config file?
For the 'admin' area, you should have something like the following i nthe authorisation section of your web.config:- <allow roles="AdminRole" />... -
How can the location roles be read from the web.config file?
Security Experts, I have a config file such as this: <configuration> <system.web> <!--- other stuff goes here --> <authentication... -
Inserting PDF file into a specific location of a PDF file not in a new page
Acrobat 6.0 has a function to concatenate multiple pdf files into a single one. I would like to use this feature but inserting pdf files at... -
how to use PHP to modify system config file?
hi, I have a problem, I want to write a Web-based system administrator system, and my development environment is RedHat 9.0 + PHP 4.2.2 + Apache... -
location of system & local database directory in windows NT
I would appreciate it if someone points me to the location of system and local database directory in a windows NT environment. Regards -
Ryan Taylor #2
Re: Location element in the Web.config file. Allow System Admin whole directory, allow others specific page
I found that part of my problem was that I was allowing all authenticated
users access to the pages. So I replaced the '?' with a '*' and this solved
the problem I also moved the ChangePassword.aspx file to its own location
just to be thorough.
Ryan Taylor
Ryan Taylor Guest
-
chandrabhan singh #3
Re: Location element in the Web.config file. Allow System Admin whole directory, allo
Hi,
I have a wired scenario in one of my ASP.net application.
I am using ASP.net membership with my custom "roleManager",
and having below tag in web.config to restrict any user not having role of "Keywords"(roles) to access "Keywords"(path) folder
<location path="Keywords">
<system.web>
<authorization>
<allow roles="Keywords"/>
<deny users="*" />
</authorization>
</system.web>
</location>
If any user with some other role allow to assess this URL (Keywords in this case) will be redirected to a custom- Access denied page.
Now things working fine but when I left my application with a inactivity of 30 min I am not able to visit the "Keywords", all the time I end up with the custom- Access denied page, if I close the browser, login again it start working fine.
Please help me in this case.
Thanks in advancechandrabhan singh Guest



Reply With Quote

