UIWebview does not load dynamically loaded resources (via jQuery mobile) through basic authentication

A bit confusing and not sure where the solution (or problem) arises.

I am creating an iPad application using UIWebviews and jQuery Mobile. I need to access my basic authentication web resource. I configured UIWebview to correctly send my credentials via an HTTP request, and all resources and those that are required on the page (CSS, Javascript, etc.) are loading correctly ....

... except for those resources that are dynamically loaded using Javascript.

I use Modernizr to load CSS and jQuery files to load a .JSON file, and none of them load when I access my page through webView. (when I access the page directly through Safari, it works fine).

I assume this is an Xcode / iOS issue, but I'm not sure where to start.

Any help / pointers would be great!

+7
source share
1 answer

The answer can be found here: How to authenticate correctly in UIWebView?

Quote:

NSString* login = @"MYDOMAIN\\myname"; NSURLCredential *credential = [NSURLCredential credentialWithUser:login password:@"mypassword" persistence:NSURLCredentialPersistenceForSession]; NSURLProtectionSpace *protectionSpace = [[NSURLProtectionSpace alloc] initWithHost:@"myhost" port:80 protocol:@"http" realm:@"myhost" // check your web site settigns or log messages of didReceiveAuthenticationChallenge authenticationMethod:NSURLAuthenticationMethodDefault]; [[NSURLCredentialStorage sharedCredentialStorage] setDefaultCredential:credential forProtectionSpace:protectionSpace]; [protectionSpace release]; 
+4
source

All Articles