• 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: Ignoring credentials in shared NSURLCredentialStorage
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Ignoring credentials in shared NSURLCredentialStorage


  • Subject: Re: Ignoring credentials in shared NSURLCredentialStorage
  • From: Becky Willrich <email@hidden>
  • Date: Fri, 11 May 2007 09:36:24 -0700

You've got the basic flow right -

- NSURLConnection issues the request and receives an authorization challenge from the server
- NSURLConnection consults NSURLCredentialStorage to find a suitable set of credentials
- NSURLCredentialStorage consults the Keychain to find the credentials
- If NSURLCredentialStorage returns a valid set of credentials, NSURLConnection will silently apply the credentials and complete the tramsission
- If NSURLCredentialStorage cannot find any credentials, only then will NSURLConnection consult its delegate via a didReceiveChallenge: message


I don't know of any way you can ask the NSURLConnection to not consult the credential storage, so I think you're stuck with removing the credentials from the storage itself. That will, as you point out, remove them from the Keychain as well. There are a couple hacks that might help you workaround this:

- After either of your apps successfully completes an authenticated transaction (i.e. you received a didReceiveChallenge: message and applied credentials successfully), extract the credentials from the CredentialStorage, then remove them from the storage, then save the extracted credentials somewhere else - a private key in the keychain will work fine. This will prevent NSURLConnection from finding the credentials, but you can retrieve them on demand from the private store.

- You can try using poseAs: to insert your own NSURLCredentialStorage class in place of the default one; it could always fail to find credentials, or maybe call through to the real NSURLCredentialStorage in all cases except the ones you want to intercept. If you do this, you are tinkering with the runtime, so be careful - you'll want to make sure and implement forward:: to send any unrecognized messages through to a "real" NSURLCredentialStorage. I'm not a runtime expert, so I don't know what all the gotchas are, just that there are more than a few.

Hope that helps,
REW
_______________________________________________
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: Ignoring credentials in shared NSURLCredentialStorage
      • From: Dave Dribin <email@hidden>
    • Re: Ignoring credentials in shared NSURLCredentialStorage
      • From: Quinn <email@hidden>
References: 
 >Ignoring credentials in shared NSURLCredentialStorage (From: Dave Dribin <email@hidden>)
 >Re: Ignoring credentials in shared NSURLCredentialStorage (From: Jerry Krinock <email@hidden>)
 >Re: Ignoring credentials in shared NSURLCredentialStorage (From: Dave Dribin <email@hidden>)
 >Re: Ignoring credentials in shared NSURLCredentialStorage (From: Jerry Krinock <email@hidden>)
 >Re: Ignoring credentials in shared NSURLCredentialStorage (From: Dave Dribin <email@hidden>)
 >Re: Ignoring credentials in shared NSURLCredentialStorage (From: Jerry Krinock <email@hidden>)
 >Re: Ignoring credentials in shared NSURLCredentialStorage (From: Dave Dribin <email@hidden>)
 >Re: Ignoring credentials in shared NSURLCredentialStorage (From: Jerry Krinock <email@hidden>)
 >Re: Ignoring credentials in shared NSURLCredentialStorage (From: Dave Dribin <email@hidden>)

  • Prev by Date: Re: Ignoring credentials in shared NSURLCredentialStorage
  • Next by Date: Re: Ignoring credentials in shared NSURLCredentialStorage
  • Previous by thread: Re: Ignoring credentials in shared NSURLCredentialStorage
  • Next by thread: Re: Ignoring credentials in shared NSURLCredentialStorage
  • Index(es):
    • Date
    • Thread