gpt4 book ai didi

openid - AspNet.Security.OpenIdConnect.Server token 撤销和注销不起作用

转载 作者:行者123 更新时间:2023-12-04 13:58:37 39 4
gpt4 key购买 nike

我已经配置了如下所述的撤销和注销端点。

.AddOpenIdConnectServer(options =>
{
options.LogoutEndpointPath = "/logout";
options.RevocationEndpointPath = "/revoke";
}

但两者都不起作用 token 撤销不会过期/撤销 token 。

对于 token 撤销,
我调试了代码,发现它拒绝了下面提到的代码中 OpenIdConnectServerHandler 类中的上下文。
var context = new ValidateRevocationRequestContext(Context, Scheme, Options, request); await Provider.ValidateRevocationRequest(context);

context.IsRejected is true after above method



request(post) 包含 clientId、clientsecret、token 作为访问 token 或刷新 token 和 token_hint_type。我没有得出结论为什么会发生这种情况?

更新 1:

通过下面提到的代码使上下文验证。
public override async Task ValidateRevocationRequest(ValidateRevocationRequestContext context) { context.Validate(); }
现在我通过调试 ASOS 代码知道没有内置的 token 撤销逻辑,对吗?如果这是这种情况,那么我需要编写我的自定义逻辑来撤销 token
public override async Task HandleRevocationRequest(HandleRevocationRequestContext context) {.. code }
现在我想知道撤销 token (访问和刷新)的方法是什么,因为这些是自包含的,而不是像 openiddict 那样存储在数据库中(我已经查看了 openiddict 的撤销逻辑)。

最佳答案

Now i got to know by debugging ASOS code that there is no built in logic for token revocation , am i right ? if this is the scenario then i need to write mine custom logic to revoke the token in



没错:ASOS 是完全无状态的。

您如何实现完全是您自己的决定。您可以使用表来存储 token 条目,例如 OpenIddict(从 Serialize*Token 事件创建)或带有已撤销 token 标识符的黑名单。

更多信息在这里: AspNet.Security.OpenIdConnect.Server. Refresh tokens

关于openid - AspNet.Security.OpenIdConnect.Server token 撤销和注销不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56393853/

39 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com