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

Wrapped error: User not authenticated on Android with TouchId and FaceId available

Open hoangcxa opened this issue 5 years ago • 17 comments

Hi, I'm using Samsung S9 (it has touch Id and faceId ).

Step to reproduce : install new project and add react-native-keychain;

on set data : Keychain.setInternetCredentials(server,username,password, {accessControl:Keychain.ACCESS_CONTROL.BIOMETRY_ANY});

on get data : const credentials = await Keychain.getInternetCredentials(server);

actual : - When use touchId there's credential callback. - When use FaceId of this device, after authentication callback success, decryptBytes in native Android still failed, and It throw android.security.keystore.UserNotAuthenticatedException: User not authenticated

Please help.

hoangcxa avatar Apr 06 '20 02:04 hoangcxa

I'm using : { "react-native-keychain": "^5.0.1", "react-native": "0.61.5" }

hoangcxa avatar Apr 08 '20 03:04 hoangcxa

Same Issue, when Running on Device with Face and touch both, Biometric authorisation works but decryption from keystore fails : { "framesToPop":1, "nativeStackAndroid":[ { "methodName":"decryptToResult", "lineNumber":616, "file":"KeychainModule.java", "class":"com.oblador.keychain.KeychainModule" }, { "methodName":"decryptCredentials", "lineNumber":592, "file":"KeychainModule.java", "class":"com.oblador.keychain.KeychainModule" }, { "methodName":"getGenericPassword", "lineNumber":293, "file":"KeychainModule.java", "class":"com.oblador.keychain.KeychainModule" }, { "methodName":"getGenericPasswordForOptions", "lineNumber":321, "file":"KeychainModule.java", "class":"com.oblador.keychain.KeychainModule" }, { "methodName":"invoke", "lineNumber":-2, "file":"Method.java", "class":"java.lang.reflect.Method" }, { "methodName":"invoke", "lineNumber":371, "file":"JavaMethodWrapper.java", "class":"com.facebook.react.bridge.JavaMethodWrapper" }, { "methodName":"invoke", "lineNumber":150, "file":"JavaModuleWrapper.java", "class":"com.facebook.react.bridge.JavaModuleWrapper" }, { "methodName":"run", "lineNumber":-2, "file":"NativeRunnable.java", "class":"com.facebook.react.bridge.queue.NativeRunnable" }, { "methodName":"handleCallback", "lineNumber":883, "file":"Handler.java", "class":"android.os.Handler" }, { "methodName":"dispatchMessage", "lineNumber":100, "file":"Handler.java", "class":"android.os.Handler" }, { "methodName":"dispatchMessage", "lineNumber":26, "file":"MessageQueueThreadHandler.java", "class":"com.facebook.react.bridge.queue.MessageQueueThreadHandler" }, { "methodName":"loop", "lineNumber":228, "file":"Looper.java", "class":"android.os.Looper" }, { "methodName":"run", "lineNumber":225, "file":"MessageQueueThreadImpl.java", "class":"com.facebook.react.bridge.queue.MessageQueueThreadImpl$4" }, { "methodName":"run", "lineNumber":919, "file":"Thread.java", "class":"java.lang.Thread" } ], "userInfo":null, "message":"Wrapped error: User not authenticated", "code":"E_CRYPTO_FAILED", "line":2132, "column":45, "sourceURL":"http://localhost:8081/index.bundle?platform=android&dev=true&minify=false" }"'"

10xamohan avatar Apr 11 '20 08:04 10xamohan

+1

krutkowski86 avatar Apr 27 '20 10:04 krutkowski86

Same issue

gastonyelmini avatar May 06 '20 15:05 gastonyelmini

Having the same issue. Any updates on this.

AnmolShrma avatar May 11 '20 05:05 AnmolShrma

+1

cschultz1272 avatar May 11 '20 22:05 cschultz1272

@cschultz1272 @AnmolShrma @gastonyelmini @krutkowski86 @10xamohan @hoangcxa

Gentlemen, I need your help to reproduce this issue. Since it happens only on specific combination of phone and Android version, I need to know what exactly you're running.

Could you please use this APK and attach here the report it produced? get-device-info.apk.zip

Best regards, John

john-y-pazekha avatar May 28 '20 13:05 john-y-pazekha

@cschultz1272 @AnmolShrma @gastonyelmini @krutkowski86 @10xamohan @hoangcxa

Gentlemen, I need your help to reproduce this issue. Since it happens only on specific combination of phone and Android version, I need to know what exactly you're running.

Could you please use this APK and attach here the report it produced? get-device-info.apk.zip

Best regards, John

@john-y-pazekha Not able to Install the apk, getting parser error for the package.

AnmolShrma avatar Jun 03 '20 05:06 AnmolShrma

Same issue. Cant install the apk - adb: failed to install get-device-info.apk: Failure [INSTALL_FAILED_TEST_ONLY: installPackageLI] I'm on Android S10e (SM-G970U), Android 10 Fingerprint works fine. Face is recognized but fails to decrypt.

Screen Shot 2020-06-23 at 8 50 50 AM

NicholasIoanJones avatar Jun 23 '20 02:06 NicholasIoanJones

I'm facing the same issue. The app is able to authenticate through fingerprint, but not through face-unlock. This leads to a really bad UX, especially for those that don't have fingerprint on their device, but only face-unlock. Does any of you found a workaround?

ifero avatar Feb 09 '21 10:02 ifero

2025 same error

jibo001 avatar Jan 18 '25 11:01 jibo001

@DorianMazur @oblador same error here. Any workaround for this or perhaps can we block Face ID on android as a hotfix or something?

Device: Samsung S23 FE with Android 14 Biometric: Both touchID and FaceID turn on react-native-keychain: 10.0.0 react-native: 0.75.5

yhl127 avatar Apr 04 '25 02:04 yhl127

Hi there,

On Android, the current Face ID implementation is categorized as a level 2 biometric. This means it doesn't meet the higher security threshold we require—level 3—for sensitive operations. Essentially, while the device supports both Face ID and fingerprint authentication, only fingerprint (or another level 3 biometric) offers the robust security guarantees keychain needs

Bowlerr avatar Apr 04 '25 10:04 Bowlerr

For touch ID, any chance your touchID is set up with a work account?

Bowlerr avatar Apr 04 '25 10:04 Bowlerr

@yhl127

Bowlerr avatar Apr 04 '25 10:04 Bowlerr

@Bowlerr thanks for the reply, that's really helpful.

Yup, realised Samsung Face ID is categorised as a L2 and won't be used for keychain. This is working correctly on 9.2.3, my Samsung only pops up fingerprint auth, but on 10.0.0 it also pops up Face ID as optional and when I click on using Face ID it returns "User not authenticated" as expected because L2 Face ID can't open keychain.

Is there a chance to not showing Face ID option for android user?

yhl127 avatar Apr 07 '25 01:04 yhl127

At least we can hide face id option

eyupdogan avatar Oct 08 '25 08:10 eyupdogan