⇥ Quickie: stop the Keychain pain
Using Keychain during development can be a pain—here’s a quick way to avoid going insane without codesigning your application.
I am currently working on a project that requires me to start authentication data in Keychain, and I thought I’d pass along a little tip that prevented me from going insane by preventing Keychain Access to ask for authorization whenever I recompile my code.
Keychain is one of those stroke-of-genius Apple systems that solve a common problem in a particularly clever way—particularly given that you can synchronize it across multiple machines, thereby not having to re-enter passwords on multiple computers.
When you’re developing an application, though, Keychain can be a huge pain—because your application’s signature changes constantly (you are, after all, adding, moving and removing both data and code), Keychain keeps asking you whether you want to allow the application to access your authentication data.
The reason why Keychain is doing is a good one—in a production environment, a change in an application’s signature indicates that the original application has been replaced by a new executable. Since this may have happened without your consent (for example, malware might have been installed without you knowing), Keychain asks you to reauthorize the application to access its data.
In development, however, this is a royal pain—your application will change constantly and you really don’t want to have to reauthorize it every time. Luckily, there’s an easy fix:
- Launch Keychain Access (it’s in the Utilities folder, or you can use Spotlight)
- Find your keychain data (check the Info.plist file in your XCode project—for example, com.afkstudio.ProjectBodoni—and then type that in the search box inside Keychain Access).
- Double click on the keychain data, then click on “Access Control”
- Make sure that “Allow all applications to access this item” is checked, then hit “Save Changes” (you will need to authenticate again, but this should be the last time)
Important note: setting things up this way should be the exception to the rule—normally, you want your Keychain to be paranoid… just in case someone really does decide to play tricks on you and your data.


Leave a comment