如何将参数添加到IdentityServer LogoutRequest模型中? [英] How do you add parameters to an IdentityServer LogoutRequest model?
问题描述
我正在使用Identity oidc-client-js库并调用
I'm using the Identity oidc-client-js library and calling
this.usermanager.signoutRedirect({ somedata: someObject.Id });
然后在注销端点中,我使用IdentityServer交互服务完成此操作
Then in the logout endpoint I do this with the IdentityServer interaction service
var logoutRequest= await _interaction.GetLogoutContextAsync(logoutId);
我本来希望somedata出现在LogoutRequest的Parameters属性中,但事实并非如此.那么如何为登出添加一些额外的参数呢?
I would have expected the somedata to show up in the Parameters property of the LogoutRequest but it doesn't. So how do I add some extra parameters to the signout?
我注意到我可以返回一个{state:'somedata'},但实际上我也不知道如何从LogoutRequest对象中检索它.因此,如果我无法添加自己的参数,该如何检索状态数据?
I noticed I can return a { state: 'somedata' } but I don't actually know how to retrieve that from the LogoutRequest object either. So if I can't add my own parameters how do I retrieve the state data?
谢谢!
推荐答案
您必须这样做
this.usermanager.signoutRedirect({ extraQueryParams: { 'key': 'value' } });
然后它们将显示在LogoutRequest的Parameters属性中
Then they'll show up in the Parameters property in the LogoutRequest
这篇关于如何将参数添加到IdentityServer LogoutRequest模型中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!