Setting the Identity/Principal from a MessageInspector in WCF
Posted
by Robert Wagner
on Stack Overflow
See other posts from Stack Overflow
or by Robert Wagner
Published on 2010-03-30T05:14:08Z
Indexed on
2010/03/30
5:23 UTC
Read the original article
Hit count: 375
I am developing a WCF service that receives the user's credentials in the SOAP header. These credentials are read on the server side using a MessageInspector. So far so good.
I want to set the Thread.CurrentPrincipal to a custom principal (CustomPrincipal), but when I do this from the MessageInspector, it gets overridden by the time the service is invoked. When is the best time to set the principal? Also what is the best way to pass the principal, identity or credentials from the inspector to that location?
© Stack Overflow or respective owner