We currently have a .net application which is using impersonation, that is setup in the web.config. The application was using this account to authenticate aganist the db. Users were asked to login and forms authentication was used for that. Recently business asked us to change the application to use windows authentication for users instead.
I setup the application to use windows authentication, impersonatation piece was left alone. Everything seems fine, my question was what is the difference between
System.Environment.UserName and HttpContext.Current.User.Identity
Initially i thought they both would return the same thing, the windows account, but UserName is giving me the impersonated account while Identity the windows account.
But according to this post: another Stackoverflow with similar question they should be the same, but i'm not seeing that. I actually want them to be different, but wanted to confirm what i'm seeing is correct.