react-native-sensitive-info icon indicating copy to clipboard operation
react-native-sensitive-info copied to clipboard

SetItem prompts user for face ID

Open thematrixmaster opened this issue 5 years ago • 6 comments

Hello,

when I use setItem with the following configuration on IOS, I am prompted to authenticate with Face ID.

SInfo.setItem('password', pass, {
    kSecAccessControl: 'kSecAccessControlBiometryAny',
    touchID: true, //add this key
    showModal: true, //add this key
    // required (iOS) -  A fallback string for iOS
    kSecUseOperationPrompt: 'Use face-id to re-authenticate',
    strings: {
        // optional (Android) - You can personalize your prompt
        description: 'Re-authenticate',
        header: 'Use fingerprint to retrieve login info',
    },
})

The expected behaviour is no prompts when using setItem and prompts when using getItem.

thematrixmaster avatar Feb 18 '21 20:02 thematrixmaster

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Mar 20 '21 22:03 stale[bot]

I have the opposite issue with the same code, and I want prompts for both. :/ Did you manage to get anywhere with this? I note a common issue with this project is issues are left to go stale and then get auto closed with no resolution.

Loxrie avatar Jun 08 '21 16:06 Loxrie

@Loxrie, unfortunately that seems to be the case. Instead of dwelling on this issue, I switched to a different package (react-native-keychain) that did the job for me.

thematrixmaster avatar Jun 10 '21 01:06 thematrixmaster

I've just done the same, I have react-native-keychain in an older project alongside a separate library for biometric auth. It seems react-native-keychain appears to now support both, so I'm giving it a whirl today.

Loxrie avatar Jun 10 '21 11:06 Loxrie

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jul 10 '21 14:07 stale[bot]

just call the Sinfo.getItem(key) with kSecAccessControl it will prompt the dialog box and after face recognition it will give you undefined then just set the value by calling SInfo.setItem(key, value) otherwise call getItem every time when the data is not undefined.

crzycoder avatar Dec 21 '21 10:12 crzycoder