Re: Questions on when credentials are used in NSURLSessionDownloadTask
Re: Questions on when credentials are used in NSURLSessionDownloadTask
- Subject: Re: Questions on when credentials are used in NSURLSessionDownloadTask
- From: Daryle Walker <email@hidden>
- Date: Sun, 19 Apr 2015 21:52:06 -0400
On Apr 18, 2015, at 10:36 PM, Daryle Walker <email@hidden> wrote:
>
> I added command-line options to include a username and password. I use them via a newly-added callback method:
>
>> - (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task
>> didReceiveChallenge:(NSURLAuthenticationChallenge *)challenge
>> completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition, NSURLCredential *))completionHandler {
>> completionHandler(challenge.previousFailureCount ? NSURLSessionAuthChallengeRejectProtectionSpace : NSURLSessionAuthChallengeUseCredential, self.usernameAndPassword);
>> }
>
> Where the “usernameAndPassword” was created with “[NSURLCredential credentialWithUser:cliUserName password:cliPassWord persistence:NSURLCredentialPersistenceForSession]”.
In a different response, I mentioned that this doesn’t work for FTP resources (which do respond to in-URL username & password). It does work for HTTP, but only for Basic Authentication. Use for a Digest Authentication HTTP send fails. What am I missing in the latter case?
—
Daryle Walker
Mac, Internet, and Video Game Junkie
darylew AT mac DOT com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden