My problem is that I have a asp.net solution that uses a seperate project for logging and now I want the log to save the logged in user. Windows authentication is used for the webapp and the app pool is run under a service account. So when I call the logger through a method(static) I want the logger to pick up who is the logged in user. The only thing I currently get is the service account that the app pool run under.
Any ideas of how to get the user from the webapp?
Make sure that your thread principal is the same as the
System.Web.HttpContext.Current.UserAt the end of the
Application_AuthenticateRequestmethod in your global.asax, you may need something like: