Where should Thread.CurrentPrincipal and HttpContext.Current.User be set when using custom principal

I created my own class inheriting from IPrincipal

and would like this object to be added to Thread.CurrentPrincipal

and HttpContext.Current.User

instead of the object ClaimsPrincipal

. This is for web api application.

I would like this to happen after the user makes a successful request for an access token. Where in the life cycle should this happen?

After I called / Token to get the access_token, I passed the bearer token back to the ChangePassword activity along with the required parameters, and the User is still set to ClaimsPrincipal. Is there a way to ensure that the Principal is set immediately upon request and after the ClaimsPrincipal is set?

+3
c # asp.net-web-api2 current-principal


source to share


No one has answered this question yet

Check out similar questions:

817
decimal and double! - Who should I use and when?
five
Why Thread.CurrentPrincipal.Identity.IsAuthenticated false when instantiated using Simple Injector
2
Setting up and accessing a custom principle using ASP.NET Core RC2 and JWT
2
Unit Testing how to install Thread.CurrentPrincipal and IsAuthenticated
1
Setting IPrincipal in a message handler or filter is not entering the controller correctly
1
Current director not set when using Owin JwtBearerAuthentication and OAuthAuthorizationServer
1
Azure Active Directory forces JWT token to be ignored
1
Web API 2 + Owin: WindowsPrincal v ClaimsPrincpal in Constructor- Get v Message
0
Identity Server 3 - Implicit Provision, Role Based Authorization
-1
Testing web API functionality with Fiddler



All Articles
Loading...
X
Show
Funny
Dev
Pics