If you define UserClaims in the definition of your ApiResources , they will be populated in context.RequestClaimTypes . For instance:
new ApiResource { Name = "TestAPI", ApiSecrets = { new Secret("secret".Sha256()) }, UserClaims = { JwtClaimTypes.Email, JwtClaimTypes.EmailVerified, JwtClaimTypes.PhoneNumber, JwtClaimTypes.PhoneNumberVerified, JwtClaimTypes.GivenName, JwtClaimTypes.FamilyName, JwtClaimTypes.PreferredUserName }, Description = "Test API", DisplayName = "Test API", Enabled = true, Scopes = { new Scope("testApiScore) } }
Your ProfileDataRequestContext.RequestClaimTypes will then contain these request requests so that your Identity Server will execute as you see fit.
source share