如何在IdentityServer4中请求声明类型?

时间:2017-08-08 09:39:00

标签: asp.net-core identityserver4

我正在关注此post以实现IdentityServer4。我有问题,在过程中的ProfileService中GetProfileDataAsync IEnumerable context.RequestedClaimTypes为空。我应该在Postman中更改我的请求以请求某些声明类型吗?我能做什么才能使context.RequestedClaimTypes包含声明类型?

我的邮递员请求如下:

Post http://localhost:57577/connect/token
Authorization: Basic Z2xvYmFsX2F...
Body (x-www-form-urlencoded):
username:user@gmail.com
password:pass
grant_type:password
scope:my_api

1 个答案:

答案 0 :(得分:1)

就像您关注的帖子一样,您必须在scope中提出请求。您可以向其添加profile email,然后您应该获得这些声明。确保将它们添加到AllowedScopes下的客户端配置(config.cs)中。