如何解决如何将自定义参数添加到Identity Server LogoutRequest?
我有一个使用最新OpenIdConnect库的旧式ASP.NET MVC(Owin)网站,以及运行最新Identity Server软件包的.NET Core 3.1 MVC Identity Server应用程序。
我需要在注销时将自定义参数传递给Identity Server(用例是,我需要显示不同的“注销原因”消息,具体取决于在客户端上发起注销的方式)。因此,我通过OpenIdRequestType.Logout
截获了n.ProtocolMessage.SetParameter("some_key","SomeValue")
设置自定义参数的通知,并且可以看到Parameters
字典中包含新值。但是,当Logout
发布到我的Identity Server中时,LogoutRequest.Parameters
集合为空。
Notifications = new OpenIdConnectAuthenticationNotifications
{
RedirectToIdentityProvider = async n =>
{
switch (n.ProtocolMessage.RequestType)
{
case OpenIdConnectRequestType.Logout:
n.ProtocolMessage.SetParameter("some_key","SomeValue");
break;
...
我在身份服务器端打电话
var logout = await _interaction.GetLogoutContextAsync(logoutId);
并发现logout.Parameters
为空。
我发现this SO question暗示oidc-client javascript库可以处理添加将显示在LogoutRequest
对象中的其他参数,因此我猜测这是可能的,我只是缺少了一些东西简单。任何想法将不胜感激。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。