Active Directory

lothos12345 said:
How do you authenicate the active directory using Windows IIS? Any help given is greatly appreciated.

This is what I have in my .Net notes that I used about a year ago...

Manage IIS > right Click Web Sites > Properties > Directory Security >
Edit Button (Auth & Access Control) > uncheck 'Enable anonymous access'
and make sure 'Integrated Widows Auth' is checkmarked

Then if you want the ASP.Net to run as the web user then add this to
your web.config
<identity impersonate="true" />

Now you can access the username by:
HttpContext.Current.User.Identity.Name;
using System.Security.Principal; User.Identity.Name;
System.Threading.Thread.CurrentPrincipal.Identity.Name;
 
Back
Top