Closed raupes closed 7 years ago
change this^
change this:
ang result theis:
Hey @raupes - not sure if you already figured this out, but the UseJwtBearerAuthentication
middleware will automatically convert JWT claims into ClaimsIdentity
claims for you. You shouldn't have to change any of the code in the example to see this in action.
I added a commit that demonstrates this here: https://github.com/nbarbettini/SimpleTokenProvider/commit/d74333065f8a33e7e58d1f05fcd21abe96766fb9
Thanks for your work. There is something I just can't figure out. I hope you will help me here. I use your provider on a core web api project. Acting with javascript on the other hand. Therefore I use jwt Bearer Authentication. ` app.UseMiddleware(Options.Create(options));
` All works quite fine. The user gets a token, i can validate if the token is valid. The authorize attribute at the controller works nice. But how can I now access the user in the controller now? How do I know there to which user the current request belongs too? HttpContext.User doesn't give me anyth. Not the Claims-Identity I returned at the GetIdentity and not any claim... Where to set it or where to get it?!
So what I need is a possibility to access the username, claim data, the identity etc. at the controller class.
Please help thank you R