How to perform an NTLM challenge on the iPhone

本秂侑毒 提交于 2019-12-09 04:55:31

问题


I'm trying to access some web services in an iPhone application.

If I GET to the .asmx page, I authenticate and get the WSDL as expected.

However, if I POST to the .asmx page, setting the SOAPAction, Content-Type, Content-Length, and HTTPBody, I just keep getting didReceiveAuthenticationChallenge messages.

Additionally, I'm trying to POST to IIS using Integrated Windows Authentication (IWA), which means I'm trying to negotiate an NTLM challenge.


回答1:


I unfortunately found my answer. NSURLConnection cannot do NTLM authentication. Here's a post about how to do NTLM authentication using the CFNetwork stack.

HTTP Post via the CFNetwork stack

Found something even better than doing all of that tediousness: Someone who has already done it!
ASIHTTPRequest

Update: There is a workaround for iOS 4 that allows for NTLM authentication again




回答2:


Sounds to me like your web-service has different read (get) and write (post) permissions. I dont think this is an issue with the iPhone or NSURLConnection at all.



来源:https://stackoverflow.com/questions/628935/how-to-perform-an-ntlm-challenge-on-the-iphone

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!