• 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
NSURLErrorDomain -1012 with NSURLAuthenticationChallenge
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSURLErrorDomain -1012 with NSURLAuthenticationChallenge


  • Subject: NSURLErrorDomain -1012 with NSURLAuthenticationChallenge
  • From: "Karim Gorjux" <email@hidden>
  • Date: Thu, 17 Aug 2006 23:00:27 +0300

Hi people!
I trying to connect with NSUrlConnection that works fine with normal sites
like my blog, but if I try to use something with authentication like
delicious's api i get this error:

Error NSURLErrorDomain -1012

The delegate method:

-(void)connection:(NSURLConnection *)connection
didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge
{
  NSLog(@"Ask for authorization");
   if ([challenge previousFailureCount] == 0) {
     NSLog(@"defaults credentialt");
       NSURLCredential *newCredential;
       newCredential = [NSURLCredential credentialWithUser:@"xxxx"
                                                password:@"xxxxx"

persistence:NSURLCredentialPersistenceNone];

     [[challenge sender] useCredential:newCredential
              forAuthenticationChallenge:challenge];

   } else {
     NSLog(@"Something fail = %d", [challenge previousFailureCount]);
       [[challenge sender] cancelAuthenticationChallenge:challenge];

   }
}


With safari the connection works good, but with the same url my code miss. Thanks in advance.

Cheers

--
Karim Gorjux
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: Re: INterface Builder & "bulleted" (password style) text field?
  • Next by Date: performSelector with reference
  • Previous by thread: Re: INterface Builder & "bulleted" (password style) text field?
  • Next by thread: Re: NSURLErrorDomain -1012 with NSURLAuthenticationChallenge
  • Index(es):
    • Date
    • Thread