0
我在.net中有一個web服務,它需要NTLM(基於Windows的IIS服務器)身份驗證,然後才能進行訪問。我如何從iOS客戶端獲得NTLM認證。來自ios的NTLM身份驗證客戶端
我在.net中有一個web服務,它需要NTLM(基於Windows的IIS服務器)身份驗證,然後才能進行訪問。我如何從iOS客戶端獲得NTLM認證。來自ios的NTLM身份驗證客戶端
您可以創建一個NSURLConnection的並執行其委託方法
在此委託,檢查挑戰
[challenge.protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodNTLM]
如果它是來回米NTLM,然後發送憑證
NSURLCredential *credentail = [NSURLCredential
credentialWithUser:<Your username>
password: <Your password>
persistence:NSURLCredentialPersistenceForSession];
[[challenge sender] useCredential:credentail forAuthenticationChallenge:_challenge];
我還沒有嘗試過自己,但也許這會有所幫助: http://stackoverflow.com/questions/12483465/afnetworking-ntlm-authentication –
我試過這個代碼。但它不被稱爲didReceiveAuthenticationChallenge委託。 – Musthafa