我做到了,现在它起作用了:
var tokenDescriptor = new SecurityTokenDescriptor()
{
NotBefore = DateTime.UtcNow,
Expires = DateTime.UtcNow.AddSeconds(client.AccessTokenLifetime),
Issuer = issuer,
Claims = new Dictionary<string, object>
{
{ JwtRegisteredClaimNames.Aud, (await _apiResourcesStore.FindByScopesNameAsync(tokenRequest.Scope.Split(" ").ToList())).Select(p => p.Name).ToArray() }
}
};
我刚刚添加了新的索赔。