【发布时间】:2019-05-23 13:07:37
【问题描述】:
我尝试使用来自 IdentityServer4 文档的 GET 请求从我的会话中注销。 HttpResponseMessage 看起来像这样:
HttpResponseMessage res = await client.GetAsync($"connect/endsession?id_token_hint={idTokenHint}&post_logout_redirect_uri={postLogoutRedirectUri}");
起初,我对 Uri 长度有疑问。当我发送请求时,方法捕获异常
Invalid URI: The Uri scheme is too long.
为了解决这个问题,我尝试将参数发送到这样的字符串中:
var parameters = $"?id_token_hint={idTokenHint}&post_logout_redirect_uri={postLogoutRedirectUri}";
HttpResponseMessage res = await client.GetAsync("connect/endsession" + parameters );
还可以像这样在 Program.cs 中添加 MaxRequestLineSize:
UseKestrel(options =>
{
options.Limits.MaxRequestLineSize = 20480;
})
也尝试过这种方式:https://stackoverflow.com/a/32457474/9541386 但对我没有任何作用。
我已尝试通过 Postman 发送此请求。请求已发送
http://localhost:5000/connect/endsession?id_token_hint={idTokenHint}&post_logout_redirect_uri={postLogoutRedirectUri}
但在 IClientStore 接口 clientId 参数的 FindClientByIdAsync 方法中,如下所示:
但正常情况下是有Id的。我看不到它之前会发生什么,因为它是第一个入口点。 如何解决 Uri 长度和错误参数的问题?
【问题讨论】:
标签: c# asp.net identityserver4