My AuthServer is currently using the following code to generate a JwtSecurityToken:
var token = new JwtSecurityToken(_issuer, audienceId, data.Identity.Claims, issued.Value.UtcDateTime, expires.Value.UtcDateTime, signingKey);
var handler = new JwtSecurityTokenHandler();
var jwt = handler.WriteToken(token);
The payload looks like this:
{
"unique_name": "myUserName",
"sub": "myUserName",
"role": "API_User",
"iss": "Automation",
"aud": "099153c2625149bc8ecb3e85e03f0022",
"exp": 1486056731,
"nbf": 1483464731
}
I would like to add some custom fields/properties within the token payload, such as ProfilePicURL, so that the payload can look something like this:
{
"unique_name": "myUserName",
"sub": "myUserName",
"role": "API_User",
"iss": "Automation",
"aud": "099153c2625149bc8ecb3e85e03f0022",
"exp": 1486056731,
"nbf": 1483464731,
"profilePicture": "http://url/user.jpg"
}
How do I go about adding these custom properties and ensuring that the token contains them?