• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Questions on when credentials are used in NSURLSessionDownloadTask
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Questions on when credentials are used in NSURLSessionDownloadTask
      • From: Jens Alfke <email@hidden>
References: 
 >Questions on when credentials are used in NSURLSessionDownloadTask (From: Daryle Walker <email@hidden>)

  • Prev by Date: Re: Questions on when credentials are used in NSURLSessionDownloadTask
  • Next by Date: Re: Questions on when credentials are used in NSURLSessionDownloadTask
  • Previous by thread: Re: Questions on when credentials are used in NSURLSessionDownloadTask
  • Next by thread: Re: Questions on when credentials are used in NSURLSessionDownloadTask
  • Index(es):
    • Date
    • Thread