Ask a Question related to ASP.NET Security, Design and Development.
-
Gery D. Dorazio #1
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 mode="Forms">
<forms name=".MyWebsite" loginUrl="Login.aspx" protection="All"
timeout="60" path="/"></forms>
</authentication>
<authorization>
<allow users="*" /> <!-- Allow all users -->
</authorization>
</system.web>
<location path="Admin" allowOverride="false">
<system.web>
<authorization>
<allow roles="Admin" />
<deny users="?" />
</authorization>
</system.web>
</location>
<location path="Account" allowOverride="false">
<system.web>
<authorization>
<allow roles="User,Admin" />
<deny users="?"/>
</authorization>
</system.web>
</location>
</configuration>
As you can see there are two directories 'Admin' and 'Account' which have
respectively the roles "Admin" and "User,Admin". I would like to be able to
programmatically read these role values from withing ASP.NET. How can I do
it?
Thanks,
Gery
--
Gery D. Dorazio
Development Engineer
EnQue Corporation
1334 Queens Road
Charlotte, NC 28207
(704) 377-3327
Gery D. Dorazio Guest
-
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... -
BUG: Server.Execute ignores web.config <location> role permissions
I have an intranet site that uses authentication mode="Windows" with identity impersonate="true". I recently implemented a site search feature that... -
Need info on how to test for roles defined in web.config.
I am using forms based authentication. I would like to be able to determine if a user has access to a specific web page through some automation... -
Web.Config and subdirectory *location* security
I've read similar posts to this issue, and I am fairly certain this configuration should work. However, when I try to request any of the pages in... -
Web References how to config to read URL from config?
It's great that VS.NET makes it so effortless to add a web reference to a web service. The problem is, I haven't figured out a way to configure the...



Reply With Quote

