I'm consume a web service that uses HTTP basic auth with an NSURLConnection. In my NSURLConnectionDelegate, I implemented –[NSURLConnectionDelegate connection:canAuthenticateAgainstProtectionSpace:],
–[NSURLConnectionDelegate connection:didCancelAuthenticationChallenge:], and
–[NSURLConnectionDelegate connection:didReceiveAuthenticationChallenge:], but none of them get called.
I've tried implementing –[NSURLConnectionDelegate connectionShouldUseCredentialStorage:] to return both YES and NO, but that had no effect.
I also ensured that my NSURLCredentialStorage was empty.
Finally, instead of implementing –[NSURLConnectionDelegate connection:canAuthenticateAgainstProtectionSpace:],
–[NSURLConnectionDelegate connection:didCancelAuthenticationChallenge:], and
–[NSURLConnectionDelegate connection:didReceiveAuthenticationChallenge:], I implemented –[NSURLConnectionDelegate connection:willSendRequestForAuthenticationChallenge:], but it wasn't called either.
What can I do to make NSURLConnection call NSURLConnectionDelegate's authentication callbacks?