Can#39;t sign out from Identity Service using endsession API(无法使用EndSession API从身份服务注销)
问题描述
我正在执行Get To
获取https://localhost:44301/connect/endsession?id_token_hint=eyJhbGciO...GzHCPw
如the docs for EndSession endpoint所示。
它似乎起作用了(在某种程度上),因为我在重定向到的方法中找到了断点。
[HttpGet("logout")]
public async Task<IActionResult> LogOut(
[FromQuery] string id_token_hint,
[FromQuery] string post_logout_redirect_uri,
[FromQuery] string session,
[FromQuery] string logoutId)
{
LogoutRequest context = await InteractionService
.GetLogoutContextAsync(logoutId);
...
}
在这里,我在logoutId中获得一个值(除非我跳过传递身份令牌,结果是Inull),而其他变量没有设置,保持为null。起初,我很高兴看到context不是null。然而,我很快就知道它设置得很差,尽管我遵循了stuff that work。
我可以看到客户的名称和ID(似乎是正确的)。但是,除数组Parameters外,其他都是null,它不包含任何元素。
我已确保传入标识令牌,而不是访问令牌。我还尝试了使用所有参数described in the docs的完整版(尝试了在我的配置和其他配置中提到的各种重定向URL)。然而,同样的(错误)行为也随之而来。
获取https://localhost:44301/connect/endsession
?ID_TOKEN_HINT=eyJhbGciO...GzHCPw
&;post_logout_redirect_uri=https://get_the_duck.off
&;会话=1337
由于我获得了突破性的命中,并收到了交互服务可解析的logoutId值,我觉得它连接正确(这是意料之中的,因为安全性如预期的那样工作)。然而,我的应用程序似乎是一个跟踪者,可以说就是不让他们走。我怀疑,有一些微小的细节是医生没有提到的(或者在我不理解的表述中模糊了)。(谷歌搜索没有给出我认为相关的任何信息。)
努力的证明(连同一堆关于安全的博客,而不是专门针对注销的)。
- Old .NET, no answer。
- Wrong platform
- Already tried, also not .NET Core
- Unrelated, even if it sound like so
- Waaay too old
推荐答案
如果你查看官方的quickstart,你可以看到他们建议使用首字母Get的组合,然后是Post,中间有一个可选的提示。最后一个Post方法implementation通过调用
await HttpContext.SignOutAsync();
这篇关于无法使用EndSession API从身份服务注销的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:无法使用EndSession API从身份服务注销
- 良好实践:如何重用 .csproj 和 .sln 文件来为 CI 创建 2022-01-01
- Web Api 中的 Swagger .netcore 3.1,使用 swagger UI 设置日期时间格式 2022-01-01
- 如何用自己压缩一个 IEnumerable 2022-01-01
- 输入按键事件处理程序 2022-01-01
- WebMatrix WebSecurity PasswordSalt 2022-01-01
- 在哪里可以找到使用中的C#/XML文档注释的好例子? 2022-01-01
- 带有服务/守护程序应用程序的 Microsoft Graph CSharp SDK 和 OneDrive for Business - 配额方面返回 null 2022-01-01
- MoreLinq maxBy vs LINQ max + where 2022-01-01
- C# 中多线程网络服务器的模式 2022-01-01
- C#MongoDB使用Builders查找派生对象 2022-09-04
