I have used Tokens to secure my Web API website, and consumed this API from an AngularJS client application.
With this I am able to login with token based authentication. My issue is that I am not able to get the UserId
in Web API controller.
Both User.Identity.GetUserId()
and RequestContext.Principal.Identity.GetUserId()
are returning null
.
How to get the UserId
in an ApiController
?