小编Mah*_*dra的帖子

IOException: IDX20807: 无法从以下位置检索文档:“System.String”。HttpResponseMessage:

我正在使用 Asp.Net Core 3.1 并通过 Challenge 方法,调用外部端点进行身份验证

public async Task<IActionResult> Challenge(string provider, string returnUrl,string userName)
        {
           
                var props = new AuthenticationProperties
                {
                    RedirectUri = Url.Action(nameof(Callback)),
                    Items =
                    {
                        { "returnUrl", returnUrl },
                        { "scheme", provider },
                    },
                    Parameters =
                    {
                        { OidcConstants.AuthorizeRequest.LoginHint, userName }
                    }
                };

                var result = Challenge(props, provider);
                return result;
            }
Run Code Online (Sandbox Code Playgroud)

错误:

An unhandled exception occurred while processing the request.
IOException: IDX20807: Unable to retrieve document from: 'System.String'. HttpResponseMessage: 'System.Net.Http.HttpResponseMessage', HttpResponseMessage.Content: 'System.String'.
Microsoft.IdentityModel.Protocols.HttpDocumentRetriever.GetDocumentAsync(string address, CancellationToken cancel)

InvalidOperationException: …
Run Code Online (Sandbox Code Playgroud)

asp.net exception

5
推荐指数
2
解决办法
1475
查看次数

标签 统计

asp.net ×1

exception ×1