Tag: ntlm

如何在iOS中发送NTLM请求

我使用json(NSJSONSerialization)和NSURL进行服务器客户端通信。 直到现在它工作正常,但现在NTLM安全已经在服务器上实现。 任何人都可以告诉我如何发送与iOS的NTLM请求? 谢谢

iPhone – NTLM,基本和其他授权使用asynchronousNSURLConnection

这是一个问题:我需要实现HTTP基本授权和MS NTLM授权。 我使用asynchronousNSURLConnection,所以我收到 -(void)connection:(NSURLConnection *)connection didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge 回电话。 这个方法的完整代码如下所示: -(void)connection:(NSURLConnection *)connection didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge { NSString* authMethod = [[challenge protectionSpace] authenticationMethod]; NSLog(@"Authentication method: %@", authMethod); NSString *userName = self.login; if ([authMethod isEqualToString:NSURLAuthenticationMethodNTLM]) { userName = [userName lastElementAfterSlash]; } else if ([authMethod isEqualToString:NSURLAuthenticationMethodNegotiate]) { userName = [NSString stringWithFormat:@"%@@%@", userName, self.url.host]; } if ([challenge previousFailureCount] <= 1) { […]

为什么我不能使HttpWebRequest使用NTLM身份validation

我正在尝试从MonoTouch中调用EWS,如下面的代码片段所示: byte[] bytes = Encoding.UTF8.GetBytes("… some xml here …"); HttpWebRequest req = WebRequest.Create("https://owa.site.com/ews/exchange.asmx") as HttpWebRequest; req.Method = "POST"; req.KeepAlive = true; req.ContentType = "text/xml"; req.ContentLength = bytes.Length; req.AuthenticationLevel = AuthenticationLevel.MutualAuthRequested; CredentialCache ch = new CredentialCache(); ch.Add(req.RequestUri, "Negotiate", new NetworkCredential("uname", "pwd", "domain")); req.Credentials = ch; Stream sreq = req.GetRequestStream(); sreq.Write(bytes, 0, bytes.Length); sreq.Close(); WebResponse resp = […]

UIWebView + Sharepoint + NTLM身份validation – 我得到stream是在打开之前发送一个事件

我一直在一个有一个简单的UIWebView的应用程序,它显示一个Sharepoint网站。 我原本以为NTLMauthentication是一个问题,但事实certificate这是非常简单的。 然而,自iOS8以来,我的应用程序一直在垃圾邮件“stream正在打开之前发送一个事件”一遍又一遍在我的日志中,该网页真的永远不能加载。 我原本以为这是我正在做的事情,所以我创build了一个小应用程序(下)以消除我的其他应用程序可能有的任何古怪,但不幸的是,我得到同样的问题。 我想我的主要问题是我不知道该从哪里开始寻找答案。 互联网有一些提到这个,但没有像[webView dontDoThat]清晰的决议。 :d 我正在玩手动添加连接到运行循环,你会在代码中看到这个。 我已经尝试了各种方式,我知道如何创build连接,但这是最近的尝试。 我开始处理SSL挑战,因为我的证书对域无效,于是我得到NTLM挑战,并发送硬编码的用户名,并通过testing。 它部分加载网站,但最终放弃加载所有的资源,我认为是这个错误。 理论的欢迎。 // // ViewController.m // // Created by Greg Frame on 10/2/14. // #import "ViewController.h" #define APPURL @"https://mysharepoint.com" #define USERNAME @"usernamehere" #define PASSWORD @"passwordhere" @interface ViewController () @end @implementation ViewController BOOL _Authenticated = NO; BOOL _SSLAuthenticated = NO; NSURLConnection *_Connection; – (void)viewDidLoad { […]