我正在使用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