I\'m trying to learn Claims for MVC 5 OWIN login. I try\'ed to keep it as simple as possible. I started with the MVC template and inserted my claims code (see below). I get an e
Your claim identity does not have ClaimTypes.NameIdentifier, you should add more into claim array:
var claims = new List
{
new Claim(ClaimTypes.Name, "username"),
new Claim(ClaimTypes.Email, "user@gmail.com"),
new Claim(ClaimTypes.NameIdentifier, "userId"), //should be userid
};
To map the information to Claim for more corrective:
ClaimTypes.Name => map to username
ClaimTypes.NameIdentifier => map to user_id
Since username is unique also, so you are able to use username for anti-forgery token support.