How can I access HttpContext.Current.User.Username from a web application in a WCF service?
How can I access HttpContext.Current.User.Username from a web application in a WCF service?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Generally you don’t – HttpContext is an ASP.NET concept and doesn’t apply to WCF unless you run it with ASP.NET Compatibility turned on.
If you want the current user in WCF then use
ServiceSecurityContext.Current.PrimaryIdentityor get the security context via the OperationContext.