我正在使用ASP.NET 5,我的解决方案中有Web API、Identity Server和Angular 2项目,我通过使用Identity Server来验证Angular 2客户端,Angular 2客户端通过在http请求中传递令牌来消耗Web API,并且Web API对令牌进行身份验证并返回响应,为此我编写了一个自定义属性来检查用户是否已通过身份验证
当我使用API时,我遇到以下异常,Web API返回500内部服务器错误。
System.InvalidOperationException: IDX10803: 无法从以下位置获取配置:http://xx.xx.xx.x:3926/.well-known/openid-configuration。 ---> System.IO.IOException: IDX10804: 无法从以下位置检索文档:http://xx.xx.xx.x:3926/.well-known/openid-configuration。 ---> System.AggregateException: 发生了一个或多个错误。---> System.Net.Http.HttpRequestException: 发送请求时发生错误。---> System.Net.WebException: 无法连接到远程服务器---> System.Net.Sockets.SocketException: 连接尝试失败,因为已连接的方在一段时间后没有正确反应,或者由于已连接的主机没有响应而导致连接失败:xx.xx.xx.x:3926 at System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult) at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)