我在用IdentityServer 4
带有参考标记的隐式流程。
我自己做了一个实现IPersistedGrantStore https://github.com/IdentityServer/IdentityServer4/blob/release/src/IdentityServer4/Stores/IPersistedGrantStore.cs它将拨款存储在 MSSQL 数据库中,效果很好。
现在我想撤销用户从前端注销时的引用令牌。因为我不想从前端调用撤销端点,所以我想在AccountController.Logout(string logoutId)
IdentityServer 中的方法(这也涵盖了从 swagger ui 注销)。
所以我注射了IIdentityServer交互服务 https://github.com/IdentityServer/IdentityServer4/blob/release/src/IdentityServer4/Services/Interfaces/IIdentityServerInteractionService.cs到 AccountController 中,但是当我打电话时
await _interaction.RevokeTokensForCurrentSessionAsync();
in the LogOut-Method
它撤销当前 subjectid/user 和 clientid 的所有令牌(该方法IPersistedGrantStore.RemoveAllAsync(string subjectId, string clientId)
叫做)。
但我只想撤销一个特定会话的令牌(该方法称为 RevokeTokensForCurrentSession
毕竟异步)已被注销。
另一种方法是调用TokenRevocationClient.RevokeAsync
为此我需要确切的令牌才能通过。但在AccountController.LogOut
我
仅具有 logoutid 和 LogoutRequest (也不包含实际令牌)。
那么隐式撤销的最佳解决方案是什么specific
用户注销时访问(引用)令牌?
提前致谢...
None
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)