On 19 Apr 2015, at 03:36, Daryle Walker <darylew@mac.com> wrote:
I was originally going to go with adding the username/password credential inside the session configuration’s credential store [...]
Just FYI, I'd recommend against pre-populating the credential store. IMO it's much better to respond to authentication challenges. * * * Having said that, you need to make sure you respond to the /right/ challenges. An authentication challenge handler should always have this general structure: - (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didReceiveChallenge:(NSURLAuthenticationChallenge *)challenge completionHandler:(...))completionHandler { if ([challenge.protectionSpace.authenticationMethod isEqual:xxx]) { ... handle the xxx challenge ... } else if ([challenge.protectionSpace.authenticationMethod isEqual:yyy]) { ... handle the yyy challenge ... } else { completionHandler(NSURLSessionAuthChallengePerformDefaultHandling, nil); } } That is, you should specifically look for the challenges you care about and handle those explicitly. If you get a challenge you don't care about, complete it with NSURLSessionAuthChallengePerformDefaultHandling. With regards the differences between FTP vs HTTP challenges, you can run into issues with the difference between NSURLAuthenticationMethodDefault and NSURLAuthenticationMethodHTTP{Basic,Digest}. In general I recommend that you handle all the password-based challenges (NSURLAuthenticationMethodDefault, NSURLAuthenticationMethodHTTP{Basic,Digest,NTLML}) in the same branch of your authentication challenge handler method. Share and Enjoy -- Quinn "The Eskimo!" <http://www.apple.com/developer/> Apple Developer Relations, Developer Technical Support, Core OS/Hardware _______________________________________________ Do not post admin requests to the list. They will be ignored. Macnetworkprog mailing list (Macnetworkprog@lists.apple.com) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/macnetworkprog/site_archiver%40lists... This email sent to site_archiver@lists.apple.com