asp.net web api2 - Web API 2 does not set Thread.CurrentPrincipal in certain scenarios -
while trying debug why custom authentication filter not work in our in-memory integration tests, found there difference in way different subclasses of httprequestcontext set principal.
most of them ( owinhttprequestcontext
, selfhosthttprequestcontext
, webhosthttprequestcontext
) set thread.principal this
webhosthttprequestcontext.cs:
public override iprincipal principal { { return _contextbase.user; } set { _contextbase.user = value; thread.currentprincipal = value; } }
but not set @ (batchhttprequestcontext
, requestbackedhttprequestcontext
).
is design decision , need rewrite parts of application not use thread.principal) or bug needs be/will fixed?
Comments
Post a Comment