I'm using Identity Server 4 and Implicit grant type. I have a SPA which makes authorization request to IS4 with response_type: 'id_token token'.
I have a simple implementation of IProfileService with GetProfileDataAsync method:
public virtual Task GetProfileDataAsync(ProfileDataRequestContext context) { context.AddRequestedClaims(context.Subject.Claims); context.IssuedClaims.Add(new Claim("custom1", "custom1")); context.IssuedClaims.Add(new Claim("custom2", "custom2")); return Task.CompletedTask; } And it works OK; I receive an access_token and an id_token. But they both contain my custom claims.
How can I include in access_token only "custom1" claim, but in id_token both "custom1" and "custom2" claims?