我正在使用ASP.NET 5,在我的解决方案中,我有Web API,Identity Server和Angular 2项目,并且我使用Identity Server对Angular 2客户端进行了身份验证,Angular 2客户端通过在http请求和web api验证令牌中传递令牌并给出响应来消费web api,为此,我写了一个自定义属性,用于检查用户是否已通过验证无法从知名/ openid配置中获取配置
当我使用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:连接尝试失败,因为连接方在一段时间后没有正确响应或建立连接因为连接的主机未能响应System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult)上的xx.xx.xx.x:3926 (位于System.Net.ServicePoint.ConnectSocketInternal(布尔connectFailure,Socket s4,Socket s6)上的 ,插座&插座,ip地址&地址,ConnectSocketState状态,IAsyncResult的asyncResult,异常&除外)
您的webapi是否可以访问身份服务器?即您可以从webapi环境中访问URL /.well-know/openid-configuration吗? – Karthik
感谢您的回复, 是的 – amol
我们创建了一个使用“/.well-know/openid-configuration”URL获取配置的api方法。 如果我们尝试从浏览器直接以及从其他应用程序尝试使用此api方法(使用jquery ajax get call) – amol