【发布时间】:2018-06-02 03:03:20
【问题描述】:
在应用程序中,当用户注销时,我会撤销当前会话的引用和刷新令牌。这是一个 API,因此其他设备可以登录到应用程序中。我想提供从所有设备注销或注销的功能。
在 Identityserver4 中,当我们注销时,我们可以使用撤销客户端来撤销一个令牌:
var client = new TokenRevocationClient(...);
//var result = await client.RevokeAccessTokenAsync(token);
//var result = await client.RevokeRefreshTokenAsync(token);
这反过来又调用IReferenceTokenStore.RemoveReferenceTokenAsync(string handle)。
现在的问题是,我将如何为用户撤销 所有 令牌?这意味着它应该调用IReferenceTokenStore.RemoveReferenceTokensAsync(string subjectId, string clientId)。
【问题讨论】:
-
我遇到了完全相反的问题,请参阅link。我想撤销单个会话/令牌,但没有可用的令牌,只有 AccountController.LogOut 方法中的 logoutid ...在您在注销时有特定令牌可用的情况下,您在 IdSrv4 的哪个位置调用了 TokenRevocationClient?
标签: asp.net-core identityserver4