I'm confused why in WebAPI it's needed to set the Principal, since each call is totally stateless. What's the benefit and the reason for set it up with your logged user info since each call is expected to be totally Stateless?
I was under the impression that one logged user was getting a server created token and that was the key that needed to be sent back and forward on each call, till the user decided to either log-off or the token expired?
public Product Get(int id)
{
string token = GetHeaderTokenSecurityAccess();
return DataLayer.GetProduct(token, id);
}
What's the main reason to "need" to set the IPrincipal in this case?