I've a DelegatingHandler in my Web-API service that, based on the headers provided, set a custom IPrincipal (ServicePrincipal) on the Thread.CurrentPrincipal and on the HttpContext.Current.User. This is all done on a call to SendAsync.
However, when the call get's into the Controller, the User property, the HttpContext.User and the Thread.CurrentPrincipal have all been mysteriously set to a RolePrincipal.
Does anyone know either what I'm doing wrong, or how to prevent the additional principal being set?
Thanks,
Kieron