Reputation: 71
Is there possibility to find user name and IP who wants to calls WCF service? (but he/she is never authenticated).
I have:
System.Threading.Thread.CurrentPrincipal.Identity.Name;
System.ServiceModel.ServiceSecurityContext.Current.PrimaryIdentity.Name;
but this contains logged in users.
Upvotes: 1
Views: 351
Reputation: 69260
No, it isn't. Either you are authenticated and have an identity on the server or you are not logged in and are anonymous.
You can also look at it from a privacy perspective: Do you want every single site that you visit on the Internet to be able to get your username?
The IP address is of course something else as it is needed for communication. There is another SO post on that issue:
Obtaining client IP address in WCF 3.0
Upvotes: 2