I followed the example on the website and I am able to get my bearer token.
However, how do I get the current user name in my api controller? I used System.Security.Claims.ClaimsPrincipal but name is null.
Thanks.
I followed the example on the website and I am able to get my bearer token.
However, how do I get the current user name in my api controller? I used System.Security.Claims.ClaimsPrincipal but name is null.
Thanks.
And replace the "email" with name. If the Name claim is not set in the token, the Name claim will also be null. You could also add this to the token in the implementation of the IProfileService.
where user is your entity or wharever.