Madhu Avinash
Madhu Avinash

Reputation: 971

share keychain access between group of apps with same team id

I would be having a master application and n number of children apps, want them to share keychain,

In entitlements.plist all the children apps would be having their own bundle identifier

The keychain-group-access that i use to add and fetch details from all the apps is PM7456S8QE.com.mango.GenericKeychain

In all the applications the keychain-group-access syntax is like

PM7456S8QE.com.mango.app1 PM7456S8QE.com.mango.app2

All the apps would be using same certificate for signing and even the mobile provision file is same

would i be able add and fetch details from keychain as all the apps have same team id ?

Upvotes: 2

Views: 1549

Answers (1)

Mecki
Mecki

Reputation: 132869

Old question but it still deserves an answer:

Multiple apps on iOS can only share keychain items if they belong to the same app group or to the same keychain access group. Therefor your apps must have a keychain access group or app group entitlement and whenever two apps list the same group names there, they can also share keychain items.

The difference between keychain access groups and app groups is that keychain access groups only allow apps to share keychain items, yet nothing else is shared. App group also allow your apps to share settings and data files and allow interactions between these apps that would otherwise not be allowed.

Note that an app can belong to any number of keychain access and app groups at the same time. The only limitation is that all groups it belongs to must be groups of the same development team. Sharing across development teams is not possible.

Apple has good documentations side about this topic that explains this kind of sharing in all detail:

https://developer.apple.com/documentation/security/keychain_services/keychain_items/sharing_access_to_keychain_items_among_a_collection_of_apps

The same rules apply to macOS, however macOS also has an alternative access control systems for keychain items that are not synchronizable and don't request to use the new keychain API introduced with iOS. In that case other sharing options are available but none of that applies to iOS.

Upvotes: 1

Related Questions