Here is the problem, I am using IIS7 inorder to host my asp.net web site , Now the thing is no matter what method is used, I am always getting the app pool identity as the current logged on user (authentication mode is windows). The following are the pieces of code i used to get the logged on user(all of them return the app pool identity).
WindowsIdentity.GetCurrent().Name
Convert.ToString(Request.ServerVariables["LOGON_USER"])
WindowsPrincipal p.Identity.Name
Convert.ToString(Request.ServerVariables["AUTH_USER"]).Trim()
Please help me regarding this cause this is troubling me a lot.
Thanks for all the information. The problem was due to some kind of bug in the ASP.NET , What I was doing is that I was redirecting from default.aspx to Home.aspx in the web application but the problem was that after redirection some how the logged in user information was being lost. So I changed the home page to Home.aspx and stored all the required information there and now it is working perfectly.
Thanks giammin for your help , really appreciate it/.