Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

TurboLag

macrumors member
Original poster
Feb 24, 2004
85
0
I have a website I need to access which requires authentication, which I have accomplished using NSURLConnection, and implementing didReceiveAuthenticationChallenge delegate method. When I try to display the page which requires authentication, all I see is text on a white background, no images or CSS content. The following code snippet is in connectionDidFinishLaunching, where receivedData is the NSMutableData returned from the NSURLConnection.

Code:
[webView loadData:(NSData  *) receivedData MIMEType:@"text/html"textEncodingName:@"UTF-8"baseURL:[ NSURLURLWithString:@"" ]];


Has anyone successfully implemented a webview which can display websites that require authentication?

If I try to reload the same page within the connectionDidFinishLoading, I can see static images, but no dynamic content.
Code:
NSURL *url = [NSURL URLWithString:URLString];
	NSURLRequest *request = [NSURLRequest requestWithURL:url];
	[webView loadRequest:request];
The webpage appears as expected in mobile Safari.
 

Str3tch76

macrumors newbie
Jul 24, 2012
1
0
Hey - I know this is a few years old, but did you ever figure out how to do this? I have exactly the same issue. A common scenario I think, I'm surprised there's no answers.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.