c# - IdentityServer4 外部身份验证 token

标签 c# asp.net-identity identityserver4

我将 IdentityServer4 设置为使用 google 进行身份验证,效果很好,包括将 token 存储在 AspNetUserTokens 中。

此外,我有一个单独的服务,需要能够在用户未登录时使用访问和刷新 token 代表用户调用谷歌的 API。

我不明白如何从身份服务器请求 token ,并使它们保持最新状态(交换访问 token 和到期日期)。我可以通过向 identityserver 添加端点来请求 token 来直接执行此操作,但是 IdentityServer 中的外部访问 token 将永远不会更新。

最佳答案

您最好的选择是使用混合流,其中刷新 token 直接存储在您的服务数据库中。 IDS在这里只是一个代理,不负责存储非自己颁发的refresh token。

关于c# - IdentityServer4 外部身份验证 token ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48696266/

相关文章:

asp.net-identity - 在 SignalR 中获取 OWIN 身份验证 cookie

c# - AspNet Identity - 重复外键的自定义 IdentityRoleClaim 和 IdentityUserRole 和 IdentityUserClaim

asp.net-core - 参数化 IdentityServer 中的 LoginUrl?

c# - IdentityServer4 Introspection Endpoint API 使用无效的散列算法

c# - 使用 LINQ 获取平均值

c# - 实现聊天功能时出现违反多重约束的错误

.net-core - 我们可以保护仅使用 aspnet 身份的 dotnet core 2.0 React App 吗?

azure-service-fabric - Azure 服务结构 : Make endpoint Input and Internal for identity server 4

c# - 如何使用 Moq 创建 stub

c# - 无法从 2 个客户端应用程序访问同一个 SQL Server 数据库