Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS Keychain Sharing #18

Open
coreykouns opened this issue Mar 10, 2017 · 18 comments
Open

iOS Keychain Sharing #18

coreykouns opened this issue Mar 10, 2017 · 18 comments

Comments

@coreykouns
Copy link

Hello developers!

Thank you very much for implementing this plugin. It is very easy to use and has a clean, simple implementation. However, my team is hoping to use this plugin in order to access a shared Keychain across multiple apps for our company, and are struggling to come up with a solution.

We have been unable to find a way to specify an accessGroup within your plugin, even after modification of the .m files within src/ios. On two separate apps, we have enabled Keychain Sharing through XCode, given them both the same Keychain Group name within their .entitlements files, and also enabled iCloud for good measure through our Apple Developer site. They both use the same Bundle Seed as well.

Would you be able to shed any light on how we might implement Keychain Sharing using your plugin? Any help or suggestions would be greatly appreciated.

@rahulvyas
Copy link

I think for now you can prefix bundle identifier in all your keys to uniquely identify between your multiple apps.

@marcRDZ
Copy link

marcRDZ commented May 11, 2017

Hi Team

I want to thank you too, I'm very noob in Ionic and Cordova and this kind of plugins make my life easier. XD
Also I have the same doubt. So did you mean that I could get a key by passing AppIdPrefix.KeychainGroup@mykey in the corresponding method or something similar?

Thanks again

@rs743
Copy link

rs743 commented May 24, 2017

Did you get key sharing to work on ionic apps

@hassanShahzad
Copy link

@coreykouns Did you find any solution?

@Cakaaa
Copy link

Cakaaa commented Mar 27, 2018

Hi there, I was wondering if you managed to make this work because I am in the same boat as you. I really need to transfer some account info to my extension and keychain sharing seems to be the best option.

@marcRDZ
Copy link

marcRDZ commented Mar 27, 2018

Hi,
I had to develop a plugin exposing that feature while I was waiting a reply here.
https://www.npmjs.com/package/cordova-plugin-fdkeychain
Hope this can help someone

@jkeczan
Copy link

jkeczan commented Mar 27, 2018 via email

@Cakaaa
Copy link

Cakaaa commented Mar 27, 2018

Thnx for the response guys. I also found this: https://plugins.telerik.com/cordova/plugin/keychain-sharing. Gonna have to check if it works. If it doesnt ill be trying your plugin @marcRDZ

@rs743
Copy link

rs743 commented Mar 27, 2018 via email

@Cakaaa
Copy link

Cakaaa commented Mar 27, 2018

@rs743 This one you mean https://github.com/Crypho/cordova-plugin-secure-storage ? How did you connect the Keychain sharing capability because i dont see anything about that capability in the docs of that plugin. Reading the ios docs, i am assuming you applied the correct attributes to the keys inside the keychain, is that correct? It says right here that attributes can define how data is shared.

In addition to the data that you want to store, keychain items also have attributes that allow you to find them later and that allow you to control how the data is used or shared.

from the docs: https://developer.apple.com/documentation/security/keychain_services/keychain_items/item_attribute_keys_and_values

@Cakaaa
Copy link

Cakaaa commented Mar 27, 2018

@jkeczan It seems that ill have a few options without implementing it myself ^^

@rs743
Copy link

rs743 commented Mar 27, 2018 via email

@Cakaaa
Copy link

Cakaaa commented Mar 27, 2018

@rs743 Thanks for the info. Much apreciated! :D

@Cakaaa
Copy link

Cakaaa commented Mar 28, 2018

@rs743 None of the callbacks are triggered. I have enabled Keychain sharing and used that as the initializer for the constructor

var ss = new cordova.plugins.SecureStorage( function () { console.log('Success')}, function (error) { console.log('Error ' + error); }, 'my_shared_keychain_string');

I have also tried using just a random string but none of it works.

Did you by any chance experience the same issue?

@johnopaluwa
Copy link

Also have same issue as @Cakaaa, none of my callbacks are triggered

@Cakaaa
Copy link

Cakaaa commented Apr 12, 2018

@johnopaluwa My problem was this piece of code in my index.html. For some reason, it blocked some of my plugins. When i removed it, everything just started working.

<meta http-equiv="Content-Security-Policy" content="default-src * mydefaultsrc:; style-src * 'self' 'unsafe-inline' 'unsafe-eval'; script-src * 'self' 'unsafe-inline' 'unsafe-eval';">

@johnopaluwa
Copy link

@Cakaaa thanks for the information

@yj-ang
Copy link

yj-ang commented Jun 18, 2019

I've added the Keychain Sharing capabilities to this plugin. (You can't use Ionic typescript bridge for this)

My fork.
https://github.com/yj-ang/cordova-plugin-ios-keychain

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants