Is it still possible to share Keychain items between apps under iOS 9?
Is it still possible to share Keychain items between apps under iOS 9?
- Subject: Is it still possible to share Keychain items between apps under iOS 9?
- From: Laurent Daudelin <email@hidden>
- Date: Fri, 01 Apr 2016 18:31:08 -0400
I have a token stored in the keychain of my app v1. I would like app v2 (a
completely separate app) to be able to access that token from the app v1's
keychain. Turned on the shared keychain capability in my project. Found
many examples on how to do it, most notably the example at
http://shaune.com.au/ios-keychain-sharing-data-between-apps/. If possible,
I would want to leave app v1 untouched, e.g. not release an update for it
for this to work. That's why I thought keychain sharing was the best way.
However, after configuring the keychain access groups in the Entitlements
file created when you turn on the Keychain Sharing, the UICKeychainStore
that is used in the example and that I added to my project is unable to
retrieve the token from app v1's keychain. In app v1, however, I used the
KeychainItemWrapper class provided by Apple to store my token. Token is
saved as the value for the kSecAttrAccount key, which is 'attr'. Thinking
that maybe something was wrong with it, I decided to do a test. I modified
app v1 to use UICKeychainStore to store a value under a different key. I
ran the app a couple of times just to make sure it was able to access the
value, which it was. Back to app v2, I double-checked the keychain access
groups in the Entitlements file according to the example. I had
the $(AppIdentifierPrefix)$(CFBundleIdentifier) set as the first item in
the keychain group and $(AppIdentifierPrefix).com.myapps.v1app as my 2nd
item in the keychain group. Yet, when running app v2 on the iPad, it is
unable to retrieve the token from the same key I used to save it in app v1.
I found another article mentioning using a shared keychain group between
the 2 (which would force me to release an update to app v1) but just for
the sake of it, I gave it a tried. I changed the keychain group in both
apps to be only com.myapps.shared for the only keychain group in the
Entitlements file. Same result. App v2 cannot access the token stored by
app v1.
So, since all the examples were 2 or 3 years old, I'm wondering if that
feature was somewhat deprecated by Apple.
Anybody has any idea or pointer?
Thanks in advance!
-Laurent.
--
Laurent Daudelin email@hidden
AIM/iChat/Skype:*LaurentDaudelin* http://www.nemesys-soft.com/
Logiciels Nemesys Software
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden