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;
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.