gpt4 book ai didi

asp.net - IOException : IDX20807: Unable to retrieve document from: 'System.String' . HttpResponseMessage:

转载 作者:行者123 更新时间:2023-12-04 12:02:06 29 4
gpt4 key购买 nike

我正在使用 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;
}
错误:
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: IDX20803: Unable to obtain configuration from: 'System.String'.
Microsoft.IdentityModel.Protocols.ConfigurationManager<T>.GetConfigurationAsync(CancellationToken cancel)
感谢,任何快速 react 。

最佳答案

也许这对您有帮助:我使用了来自 https://dev.to/moe23/asp-net-core-5-rest-api-authentication-with-jwt-step-by-step-140d 的脚手架示例
在此示例中,引用了 Nuget 包 System.IdentityModel.Tokens.Jwt。
我删除了它,因为我不需要它,错误消失了

关于asp.net - IOException : IDX20807: Unable to retrieve document from: 'System.String' . HttpResponseMessage:,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66865872/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com