0
我正在研究需要从我们基于iis的网站下载网页的应用程序。如果我在我的iPad上登录到我的无线连接的域名,我所连接的站点似乎使用该登录名作为我的凭据。但是,如果我没有连接到域,或者我作为无权访问该网页的用户进行连接,它会触发didReceiveAuthenticationChallenge
,否则它不会。如果我使用Safari连接到相同的页面,它会要求进行认证。我希望每次都能让应用程序进行身份验证。任何帮助,将不胜感激。在ios应用程序中影响didReceiveAuthenticationChallenge的域名登录
代码请求页面:
NSError *error = nil;
// assign the cmh url from user prefs
NSURL *url = [NSURL URLWithString:cmhUrl];
// Put that URL into an NSURLRequest
NSURLRequest *req = [NSURLRequest requestWithURL:url];
[req setCachePolicy:NSURLRequestReloadIgnoringLocalCacheData];
// Create a connection that will exchange this request for data from the URL
connection = [[NSURLConnection alloc] initWithRequest:req
delegate:self
startImmediately:YES];