如何在IdentityServer中获取角色声明

时间:2022-11-22 19:57:18

I have users that're part of Roles which have Claims specified for them. I authenticate my users using IdentityServer (version 3 at the moment) with IncludeAllClaimsForUser set to true. I expected IdentityServer to automatically retrieve Role Claims but it doesn't.

我有用户是Roles的一部分,它们为它们指定了声明。我使用IdentityServer(目前版本3)对我的用户进行身份验证,并将IncludeAllClaimsForUser设置为true。我希望IdentityServer能够自动检索角色声明,但事实并非如此。

Is there a way to make IdentityServer care about Role Claims or is customizing through ProfileServer is the only way to go?

有没有办法让IdentityServer关注角色声明或通过ProfileServer进行自定义是唯一的方法?

1 个解决方案

#1


1  

if you need user information you have to use userinfo endpoint or while making a request for token add the scope that is related to user claim.

如果您需要用户信息,则必须使用userinfo端点或在发出令牌请求时添加与用户声明相关的范围。

#1


1  

if you need user information you have to use userinfo endpoint or while making a request for token add the scope that is related to user claim.

如果您需要用户信息,则必须使用userinfo端点或在发出令牌请求时添加与用户声明相关的范围。