Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Ignoring credentials in shared NSURLCredentialStorage




On 2007 May, 10, at 13:29, Dave Dribin wrote:

Hello again,

Is there some way to have NSURLConnection ignore credentials in the shared NSURLCredentialStorage? From testing, it seems that if another app has inserted credentials into the shared store, my app will always use that username/password. The connection:didReceiveAuthenticationChallenge: delegate method does not seem to get called and allow me to set credentials. I'd like my app to override/ignore what's in there so I can use a different username/password.

I'm not sure about the relation with NSURLCredentialStorage, but I had this problem with NSHTTPCookieStorage. For example, if the user is logged into Google with Safari, and has checked "Keep me logged in on this computer", then they have a cookie which any app using the Apple URL Loading System can access, until they log out.


So I constructed a quite complicated state machine which, among other things, checks to see what account they are logged in with, then if necessary puts up a dialog asking them if it's OK to log out, then logs in with the other account. (Safari puts passwords Keychain, so you can get them from there).

If this is the problem that you have, you might want to play with my app Bookdog as an example of "one way to solve the problem". See http://sheepsystems.com/products/bookdog/. Let me know if you have any questions or want any code. Of course, if your app doesn't need to be polite, you could just delete the cookie.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/macnetworkprog/email@hidden


This email sent to email@hidden
References: 
 >Ignoring credentials in shared NSURLCredentialStorage (From: Dave Dribin <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.