我只有一个混合流客户端设置了一个AllowedScopes.的IdentityServer,它为"all_claims"设置了一个在另一台计算机上,我有一个MVC应用程序,它连接到IdSvr来登录用户。它还为/admin设置了IdMgr绑定。我可以登录到主应用程序和IdMgr没有问题。另外,在用户登录后的主应用程序中,我得到了所有预期的声明,但不是在IdMgr中。
我试图在IdMgr中添加一些基于声明的自定义逻辑。但是当我在任何Thread.CurrentPrincipal控制器中获得IdMgr时,它是空的!我得到的只是一个只有角色声明的ClaimsPrincipal对象。它还有一个具有以下属性的ClaimsIdentity对象:
AuthenticationType: "Bearer"
IsAuthenticated: true
NameClaimType: "name"
RoleClaimType: "role"其他的都是空的。甚至没有用户的名称或Id。为什么是这样,我如何才能在IdentityManager中获得所有索赔?
要再现这一点,只需检查GetUsersAsync方法中的UsersController中的UsersController。
链接到此https://github.com/IdentityManager/IdentityManager/issues/216 on GitHub
发布于 2016-03-26 11:27:36
在标识管理器作用域中尝试IncludeAllClaimsForUser = true
new Scope{
Name = IdentityManager.Constants.IdMgrScope,
DisplayName = "IdentityManager",
Description = "Authorization for IdentityManager",
Type = ScopeType.Identity,
IncludeAllClaimsForUser = true发布于 2016-03-25 21:35:09
如果您希望为IdMgr定制索赔,那么我建议您在管道中进行索赔转换。
https://stackoverflow.com/questions/36226450
复制相似问题