Question

In my Application, I create on Client-side my own Principal-Object, which i set like

Thread.CurrentPrincipal = myPrincipal;

Now, when I call a WCF-Service (TCP/IP), I should also have this Principal in the Server-side Thread of this called WCF-Service. Is there something that I can configure to do this, or does I have to implement this myself?

Thanks for your hints.

Was it helpful?

Solution

If we're talking about windows principals, look at WCF authentication and security options. It's not trivial.

If you have a custom principal object, then my suggestion is to implement message inspectors, serialize the principal inside a message header and unpack it on the other side. This works pretty well for us in a number of projects, and doesn't require any special WCF settings.

OTHER TIPS

this will be done implicitly as each request in WCF should have it's Iprincipal.Identity have you tried something like this in your server side

IPrincipal principal =   Thread.CurrentPrincipal;
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top