Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Web.Config file Security Settings

Status
Not open for further replies.

jmeckley

Programmer
Jul 15, 2002
5,269
US
I have a directory in my app that I only want certain users to have access to. How can I setup the web.config file to only allow specific users access?

I am using windows authentication with impersenation.
the users names will be DOMAIN\user1 and DOMAIN\user2

Jason Meckley
Database Analyst
WITF
 
Here is a copy of one of my Web.config files that I use to secure a directory. I am using forms security so you will have to test this.

<?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; ?>
<configuration>

<system.web>


<authorization>
<deny users=&quot;?&quot; /> <!-- Allow all users -->

<!-- <allow users=&quot;[comma separated list of users]&quot;
roles=&quot;[comma separated list of roles]&quot;/>
<deny users=&quot;[comma separated list of users]&quot;
roles=&quot;[comma separated list of roles]&quot;/>
-->
</authorization>

</system.web>

</configuration>




AGIMA - professional web hosting is our business.

AGIMA Computing
 
I have that much for my overall app, I need additional security settings of a sub directory within my app. Thank you for the config though.

Jason Meckley
Database Analyst
WITF
 
Just drop this web.config in each of the directorys that you want to secure (or unsecure). Depending on the contents of the Web.config file.

If you know what I mean.


AGIMA - professional web hosting is our business.

AGIMA Computing
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top