我偶尔在使用Azure AD进行身份验证时遇到问题。我收到了页面底部显示的错误。
我设置了以下内容
IdentityModelEventSource.ShowPII = true;
以查看日志以找出我缺少的配置。我在哪里可以看到日志?
我在计算机上本地运行WebAPI,URL为https://localhost:16135/weatherforecast
。我通过POSTMAN获得了令牌,该令牌成功了,但是使用该令牌执行WebAPI却失败,并显示错误。这是我看到的错误:
System.InvalidOperationException: IDX20803: Unable to obtain configuration from: '[PII is hidden. For more details, see https://aka.ms/IdentityModel/PII.]'.
---> System.IO.IOException: IDX20804: Unable to retrieve document from: '[PII is hidden. For more details, see https://aka.ms/IdentityModel/PII.]'.
---> System.Net.Http.HttpRequestException: No such host is known.
---> System.Net.Sockets.SocketException (11001): No such host is known.
错误显示“未知主机”
如果要从本地计算机外部调用WebAPI。然后它将找不到本地主机。
尝试在uri中使用您的计算机名称。