i have 2 servers web server and the app server on the app server i have WCF running . in any function on the wcf i"m trying to get the current user with System.Web.HttpContext.Current.User but i"m getting null there is a way to get the user without move it with paramter to the any functions ?
Asked
Active
Viewed 350 times
2
-
What is your wcf configuration? – evgenyl Apr 23 '13 at 08:10
2 Answers
2
WCF tries to distance itself from ASP.NET, because it can run in any number of hosts - not just ASP.NET. This also allows it to cut out large chunks of the ASP.NET pipe, improving throughput. You can force it to use ASP.NET mode by adding:
<serviceHostingEnvironment aspNetCompatibilityEnabled="true"/>
to the configuration, but frankly you're better off (IMO) using the thread principal instead. WCF has full support for the principal model.

Marc Gravell
- 1,026,079
- 266
- 2,566
- 2,900
1
Try use ServiceSecurityContext.Current.PrimaryIdentity
.

Vladimir
- 7,345
- 4
- 34
- 39
-
-
Ok working http://sankarsan.wordpress.com/2010/07/25/identity-securitycallcontext-in-wcf/ thanks – avnic Apr 23 '13 at 09:17