Is not possible to have multiple accessControl for different usernames.
Basically I want to store multiple data (more precisely 3: accessToken, refreshToken, local storage encryption) in keychain and I'm achieving it by using different service names for each (username, password). Although I think this is very weird and non-intuitive, since in native ios and android libraries we can set different (username,password) without overwriting old ones, but ok.
The problem is: I want to have a different accessControl for one specific username. But I simply can't because when I set it for one username it also set for all other usernames. Is it possible to overcome this with this library?
Hi @MFrat, could you please share the names of libraries that allow this?
Hi @DorianMazur, Thank you for being an active maintainer! I need some suggestions on how to use this library to store two different values under different keychain options. Each value may be associated with a different service class, and I would like to apply different keychain options for unlocking them during retrieval like one using biometric authentication and the other with a direct method. Is this still feasible using this library?
@vikassharma96 Absolutely. Use different service for each item.
// First
await setGenericPassword(
'firstKey',
firstKeyData,
{
service: 'com.myapp.firstKey'
storage: STORAGE_TYPE.AES_GCM_NO_AUTH,
}
);
// Second
await setGenericPassword(
'secondKey',
secondKeyData,
{
service: 'com.myapp.secondKey'
storage: STORAGE_TYPE.AES_GCM,
}
);