react-native-keychain icon indicating copy to clipboard operation
react-native-keychain copied to clipboard

Access Keychain data from other apps

Open tommycarpi opened this issue 5 years ago • 5 comments

Say I have an app (let's call it A) written in Swift that already uses the iCloud Keychain. This is the configuration/path used:

Keychain Group: com.aaa Keychain Service: com.bbb Key: ccc

So I basically set the Service com.bbb and retrieve the value under the key ccc.

Say I wanted to develop a new app (let's call it B) in react Native that reads/writes to the exact same Keychain segment, to share data between A and B.

Is it possible to read such value with react-native-keychain (provided in the Xcode entitlements I set Keychain Group to com.aaa)?

tommycarpi avatar Oct 31 '20 19:10 tommycarpi

apps should not be allowed to access the keychain of another app. This is only possible if the user has rooted their device. The best way forward is to setup some sort of communication between the two apps to send the data to the other app if that apps needs it

RikSchefferOberon avatar Nov 17 '20 16:11 RikSchefferOberon

If both apps A and B are signed with the same developer certificate in Xcode and keychain sharing is enabled, I think this should work.

@RikSchefferOberon https://developer.apple.com/documentation/security/keychain_services/keychain_items/sharing_access_to_keychain_items_among_a_collection_of_apps specifically mentions the use case of @tommycarpi

timotgl avatar Apr 21 '21 10:04 timotgl

@timotgl I was not aware of that, thanks for pointing it out

RikSchefferOberon avatar Apr 21 '21 11:04 RikSchefferOberon

resolve it?

baesumin avatar Jan 17 '23 09:01 baesumin

resolve it?

you can follow the IOS instruction https://developer.apple.com/documentation/security/keychain_services/keychain_items/sharing_access_to_keychain_items_among_a_collection_of_apps/ Screen Shot 2023-08-22 at 3 37 44 PM

chanphiromsok avatar Aug 22 '23 08:08 chanphiromsok