Jump to content
Xtreme .Net Talk

Recommended Posts

Posted
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;

Experience is something you don't get until just after the moment you needed it

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...