When you define an api resource (have a look in Config.cs), you can do that :
new ApiResource
{
Name = "api",
DisplayName = "My API",
UserClaims =
{
JwtClaimTypes.Id,
JwtClaimTypes.Subject,
JwtClaimTypes.Email
}
}
It defines that your API will receive those claims.
EDIT :
It's better if you add the associate resource's to the GetIdentityResources function (see Config.cs)
Have a glance in the offical documentation to have a better picture
http://docs.identityserver.io/en/release/topics/resources.html .
I give you a complete example from a personal project:
public static IEnumerable<IdentityResource> GetIdentityResources()
{
//>Declaration
var lIdentityResources = new List<IdentityResource>
{
new IdentityResources.OpenId(),
new IdentityResources.Profile(),
new IdentityResources.Email()
};
//>Processing
foreach (var lAPIResource in GetApiResources())
{
lIdentityResources.Add(new IdentityResource(lAPIResource.Name,
lAPIResource.UserClaims));
}
//>Return
return lIdentityResources;
}
public static IEnumerable<ApiResource> GetApiResources()
{
return new List<ApiResource>
{
new ApiResource
{
Name = "api1",
DisplayName = "api1 API",
UserClaims =
{
JwtClaimTypes.Id,
JwtClaimTypes.Subject,
JwtClaimTypes.Email
}
}
};
}