我想加载UIWebView中的Windows身份validation的url。 以下是我的代码。
public override void WillSendRequestForAuthenticationChallenge(NSUrlConnection connection,NSUrlAuthenticationChallenge challenge) { if (challenge.ProtectionSpace.AuthenticationMethod == NSUrlProtectionSpace.AuthenticationMethodNTLM) { if (challenge.PrevIoUsFailureCount > 0) { challenge.Sender.CancelAuthenticationChallenge(challenge); } else { var credentialSpace = new NSUrlProtectionSpace("http://authenticatedurl.com",80,"http","http://authenticatedurl.com","NTLM"); NSUrlCredentialStorage credentialStorage = NSUrlCredentialStorage.SharedCredentialStorage; var credential = new NSUrlCredential ("username","password",NSUrlCredentialPersistence.ForSession); credentialStorage.SetDefaultCredential (credential,credentialSpace); connection.UseCredential (credential,challenge); connection.PerformDefaultHandling (challenge); isAuthenticated = true; } } }
上面的委托被调用,并成功执行UserCredential没有任何错误,但网站没有加载。 它继续旋转几个小时。 我在这里做错了什么?
如何更改MenuFlyout的背景animation?
具有位域的结构的存储器布局
Linux:识别内存中的页面
WaitForSingleObject问题
防止CMakefind已安装的库而不是“本地”库
var credentialSpace = new NSUrlProtectionSpace(“ http://authenticatedurl.com ”,80,“http”,“ http://authenticatedurl.com ”,“NTLM”);
尝试这个,
var credentialSpace = new NSUrlProtectionSpace(“authenticatedurl.com”,80,“http”,“authenticatedurl.com”,“NTLM”);
它应该工作!
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。