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

iOS 15 simulator gets `false` return from `getGenericPassword()`

Open esbenvb opened this issue 4 years ago • 13 comments

I just upgraded to iOS 15 and spent half my day troubleshooting weird login behavior on iOS 15 simulators.

It seems like the getGenericPassword() always returns false. I went into the native ObjC code and I can see that the values are stored as expected in the Keychain but when I try to get them out, it ends up with resolving with a @(NO) which becomes false on the JS side.

When debugguing, I can see that SecItemCopyMatching gives me an errSecItemNotFound = -25300 (see screenshot)

I'm running RN 0.63.3 and the latest version of RNKeychain, but also tried with version 6.xx with same result.

It works as expected on an iOS 14.5 simulator as well as my iPhone 12 Pro Max with iOS 15.0

image

esbenvb avatar Sep 23 '21 20:09 esbenvb

I think iOS 15 has broken a whole lot of keychain related methods. I am experiencing similar funky behaviour across the board with various methods in this lib.

AlexHooperDev avatar Sep 27 '21 09:09 AlexHooperDev

same issue here, been present since the ios 15 simulator beta

afonso-tsx avatar Sep 30 '21 10:09 afonso-tsx

The error is being triggered here : https://github.com/oblador/react-native-keychain/blob/master/RNKeychainManager/RNKeychainManager.m#L237-L241 SecItemAdd returns OSStatus -25293 (errSecAuthFailed)

Seems to be the same issue as described in https://developer.apple.com/forums/thread/685773

marora90 avatar Sep 30 '21 18:09 marora90

I'm facing the same issue on iOS 15. Everything works well on iOS 15. Any updates? Thank you guys so much

anhquan291 avatar Oct 15 '21 02:10 anhquan291

@anhquan291
Do you face this issue on a simulator, or real device? I still don't know if this is a Simulator only bug, or also reproducible on an real iPhone.

Wyctus avatar Oct 15 '21 09:10 Wyctus

@anhquan291 Do you face this issue on a simulator, or real device? I still don't know if this is a Simulator only bug, or also reproducible on an real iPhone. @Wyctus I'm not be able to test on Simulator yet. Only have the iPA build on real Device. The check Biometrics support and setPassword work well but the getPassword. :(

quannavnlab avatar Oct 18 '21 02:10 quannavnlab

@oblador Is there any progress with this issue? Thanks!

Wyctus avatar Oct 27 '21 14:10 Wyctus

I am experiencing this issue on a physical device, iPhone XR iOS 14.4.2, I also have reports of this happening on a physical iPhone XR, iOS 14.5.

fendorio avatar Nov 10 '21 12:11 fendorio

Any updates?

piotrsmajek avatar Jan 10 '22 15:01 piotrsmajek

Hi guys,

I've been taking a look and it seems that this may be an issue due to the new iOS15 ability to pre-warm the apps with no need for user interaction and even when the device is locked: https://sourcediving.com/solving-mysterious-logout-issues-on-ios-15-8b818c089466

Apple documentation here: https://developer.apple.com/documentation/uikit/app_and_environment/responding_to_the_launch_of_your_app/about_the_app_launch_sequence?language=objc#3894431

If this is the actual reason, changing the accessible to AFTER_FIRST_UNLOCK or ALWAYS could do the trick

nuvolarmobileteam avatar Feb 09 '22 15:02 nuvolarmobileteam

If this is the actual reason, changing the accessible to AFTER_FIRST_UNLOCK or ALLWAYS could do the trick

To me it seems like this change will sometimes solve the problem but not aways. I still have issues with this :(

esbenvb avatar Feb 10 '22 08:02 esbenvb

Any updates?

paularolim avatar Feb 16 '22 20:02 paularolim

Any updates?

manhhoan76 avatar Jul 04 '22 06:07 manhhoan76