asp.net web api - Web-API, DelegatingHandler and security. Principal is reset in Controller -
i've delegatinghandler in web-api service that, based on headers provided, set custom iprincipal (serviceprincipal) on thread.currentprincipal , on httpcontext.current.user. done on call sendasync.
however, when call get's controller, user property, httpcontext.user , thread.currentprincipal have been mysteriously set roleprincipal.
does know either i'm doing wrong, or how prevent additional principal being set?
thanks,
kieron
i know question old, having similar issue trying current user within function overriding delegatinghandler.sendasync(). iprincipal object doesn't seem initialized until after call base.sendasync(). after line called, iprincipal object should have user information.
i used request.getrequestcontext().principal retrieve it, i'm guessing thread.currentprincipal work too.
Comments
Post a Comment