本文介绍了“ InvalidOperationException:IDX20803:无法从以下位置获取配置:[[PII被隐藏]'”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已经在Docker上部署了API和客户端应用程序,但是在我生命中,Web应用程序无法调用该API,因此我一直遇到异常。
I've deployed my API and Client app on Docker, but for the life of me, the web app cannot call the API, I keep getting an exception.
我添加了
IdentityModelEventSource.ShowPII = true;
例外:
System.InvalidOperationException: IDX20803: Unable to obtain configuration from: '[PII is hidden]'.
at Microsoft.IdentityModel.Protocols.ConfigurationManager`1.GetConfigurationAsync(CancellationToken cancel)
at Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler.HandleAuthenticateAsync()
at Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler.HandleAuthenticateAsync()
at Microsoft.AspNetCore.Authentication.AuthenticationHandler`1.AuthenticateAsync()
at Microsoft.AspNetCore.Authentication.AuthenticationService.AuthenticateAsync(HttpContext context, String scheme)
at IdentityServer4.AccessTokenValidation.IdentityServerAuthenticationHandler.HandleAuthenticateAsync()
at Microsoft.AspNetCore.Authentication.AuthenticationHandler`1.AuthenticateAsync()
at Microsoft.AspNetCore.Authentication.AuthenticationService.AuthenticateAsync(HttpContext context, String scheme)
at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Cors.Infrastructure.CorsMiddleware.InvokeCore(HttpContext context)
at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)
推荐答案
我们需要启用对PII日志的查看,以便我们可以查看有关该错误的更多详细信息:
在ConfigureServices()中将以下行添加到Startup.cs
We need to enable viewing of PII logs so we can see more details about the error:Add the following line in ConfigureServices() to Startup.cs
public void ConfigureServices(IServiceCollection services)
{
IdentityModelEventSource.ShowPII = true; //Add this line
....
这篇关于“ InvalidOperationException:IDX20803:无法从以下位置获取配置:[[PII被隐藏]'”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!