Вопрос

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.

Это было полезно?

Решение

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.

Другие советы

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;
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top