2016-07-27 39 views
1

我使用角度爲客戶端和codeigniter PHP爲後端和其他服務器。當我打開其餘的服務器上基本身份驗證我可以通過這種方式從客戶端到達的數據:angularjs消化問題和缺乏理解

  method: 'GET', 
      url: 'http://localhost/myDomain', 
      headers: {"Authorization": "Basic " + btoa("username:password")} 

但是,當我打開我消化不能只是改變基本消化,達到數據。有誰知道爲什麼?

感謝

+0

[AngularJS和摘要HTTP認證]的可能的複製(http://stackoverflow.com/questions/17531753/angularjs-and-digest-http-authentication) –

回答

0

基本和摘要就像不同的語言,你也不能說「怎麼樣[R U」到非英語爲母語的人,期待一個有用的答案。事實上,Digest使用質詢響應協議,而Basic不支持。

更清楚的是,您的HTTP標頭值需要通過用戶名/密碼組合加上以前的服務器答案來計算。

sequence diagram visualizing the HTTP digest authentification

+0

抱歉,但如何然後設置我角碼? – Sasa

+0

檢出http://stackoverflow.com/questions/17531753/angularjs-and-digest-http-authentication –