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];