tags:

views:

75

answers:

2

Is there a way to retrieve the calling application name in a wcf service?

A: 

since wcf may be consumed by may different endpoints i dont belive that is the case. Heres a link to msdn for best practices on security for wcf, hope it helps.

almog.ori
+1  A: 

The ServiceSecurityContext would be the place to start, but I'd be very surprised if such a thing exists.

If you require this by your client think about adding message headers and force them to insert a client application name, or - if you don't trust anybody - give them separate certificates and use them to find out "who" is calling you.

Marc Wittke
Agree with @Marc, the nearest you're going to get is either a) arbitrary user supplied string like AppName b) mandatory credential e.g. an AppID, Cert, Token or other evidence to identify the caller - doesn't necessarily have to be a cert, I'd suggest that should ensure that you validate that you issued or trusted the evidence originally. e.g. a lookup into a db of issued tokens, or validating a cert root.
stephbu