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

Support to retrieve specific account name (iOS) #234

Open
GabrielePrestifilippo opened this issue Aug 7, 2019 · 4 comments
Open

Support to retrieve specific account name (iOS) #234

GabrielePrestifilippo opened this issue Aug 7, 2019 · 4 comments

Comments

@GabrielePrestifilippo
Copy link

Currently, this library allows saving an account(key)-value in a specific service, which is mapped in iOS in kSecAttrAccount for the key, kSecValueData for the data and kSecAttrService for the service.

However, in a single service, iOS allows saving multiple accounts kSecAttrAccount with their specific value.
This means multiple accounts can be saved. At the moment the library retrieves just the first that is found, and this won't create any problem if we try to store and retrieve a specific account(key)-value data for a specific service, if that was stored using this library.

However, if we try to retrieve some values saved from either a different application or a different library (e.g. consider a migration from a previous version of the app or sharing the keychain with another application), we could incur into a problem because we will always retrieve the first account and we won't be able to access the specific account we are interested into.

The solution would be to either specify the account we need to access as an optional parameter for the getGenericPassword or create a completely different method to specify more options and give developers more freedom.

@oblador and @mantainers, do you have any thoughts about this?

@simonedavico
Copy link

Supporting all iOS query options would be nice.

@veermangat
Copy link

I have the same issue, would be nice if we could pass the account to retrieve specific entries and not just the first one.

I am stuck, because I am trying to upgrade from a previous version of the app. And with this library I can only fetch the first value. If the user has had multiple accounts, there is no way to fetch the latest one currently.

@simonedavico
Copy link

@veermangat if you are stuck you can use my fork of the library.

I have not released this as a npm package, I am referring to it by URL in my package.json file. If @oblador will accept a PR I will gladly prepare one.

@DorianMazur
Copy link
Collaborator

Related to #643

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

4 participants