I've been playing with IdentityServer4. Absolutely love it.
I have created a Profile Service that does the following:
public class ProfileService : IProfileService
public Task GetProfileDataAsync(ProfileDataRequestContext context)
context.IssuedClaims.Add(new Claim("test-claim", "test-value"));
public Task IsActiveAsync(IsActiveContext context)
context.IsActive = true;
The profile service is called whenever IdentityServer needs to return claims about a user to a client applications.
If you request an identity and access token - it will get called twice (since you might be putting different claims into each token type).