entity-framework-core - IdentityServer4 如何将 ClientProperties 转换为 token

标签 entity-framework-core identityserver4 openid-connect

我有一个带有 EFCore 实现的 IdentityServer4,它运行良好。我需要进行更改以获取 token 中包含的一些客户端信息,这证明存在问题。我可以将信息包含在 ClientClaims 表中,并在 token 中返回,但我的理解是我应该将此类信息放在 ClientProperties 表中。当我这样做时,它不会在 token 中返回,而且我找不到有关如何将数据从 ClientProperties 表获取到 token 中的任何信息。

您可能会问为什么我不只使用 ClientClaims 表,但我使用该表来存储客户端可以访问我的系统的哪些区域,因此不想将其用于交叉目的。

您能提供的任何帮助将不胜感激。

最佳答案

properties

Dictionary to hold any custom client-specific values as needed.



客户端属性只是一个字典,您可以使用它来存储有关客户端的额外信息。

这是我使用它的一个例子。
Id  ClientId    Key         Value
265 25          updatedby   21248582
266 25          updateddate 2018-05-30T06:45:10.2389386+00:00

没有在哪里说明此信息应作为 claim 的一部分。

你可能会说 "But a i already stated i dont want to use ClientClaims"但这就是ClientClaims是为了。

关于entity-framework-core - IdentityServer4 如何将 ClientProperties 转换为 token ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50903568/

相关文章:

sql - Entity Framework Core - 手动将 id 分配给链接的实体

c# - 无法检索项目元数据。确保这是一个基于MSBuild的.NET Core项目。 (迁移)

asp.net - Controller 中的 Linq 查询时间太长

asp.net-core-mvc - 支持多个同类型的AuthenticationSchemes

c# - InvalidOperationException : Key type not specified. Microsoft.AspNetCore.ApiAuthorization.IdentityServer.ConfigureSigningCredentials.LoadKey()

c# - 身份服务器刷新 token 资源所有者密码凭证流

c# - 如何正确使用 ValueGeneratedOnUpdate()?

c# - Identityserver4/OpenId Connect,混合模式, token 刷新失败

asp.net - OAuth2.0/OIDC 中的 grant_type 与 response_type

oauth-2.0 - 在线申请是否需要刷新 token