Documentation icon indicating copy to clipboard operation
Documentation copied to clipboard

Custom Claims in Access Token

Open praveenupadhyay20 opened this issue 8 years ago • 0 comments

Hi,

1-) I am trying to add few claims to access token, While debugging I observerd, it has been added to AuthenticationResult- Claims, But I do not see in JWT Access Token. Please find the image below for reference. I have added one claim named "mem" value 123.

I have added this as below in AuthenticationLocalAsync method.

IEnumerable<Claim> claim = new Claim[] { new Claim("mem", "123") };

            context.AuthenticateResult =
                new AuthenticateResult(context.UserName, context.UserName, claim);

image

2-) 2nd issue is - GetProfileDataAsync method is not getting executed when I am using PostMan as client, As the API server is being developed for Mobile client, So I am using PostMan client. In login itself I want to get the claim which I have mentioned in the 1st point. Please help, I already spent a lot of time to figure out these two points.

Thanks

praveenupadhyay20 avatar May 16 '16 06:05 praveenupadhyay20