I am developing a WCF service that gets user credentials in a SOAP header. These credentials are read on the server side using MessageInspector. So far so good.
I want to set Thread.CurrentPrincipal for a custom principal (CustomPrincipal), but when I do this from MessageInspector, it becomes overridden by the time the service starts. When is the best time to set up a principal? What is the best way to transfer the principal, ID, or credentials from the inspector to this place?
source share