-
Notifications
You must be signed in to change notification settings - Fork 952
Keychain data seems to be disappearing #75
Comments
Also, not sure if this is related to the issue: http://www.coderexception.com/C6bmuz36PXiQixJi/ios-keychain-data-lost-upon-iphone-memory-pressure @soffes: do you store the password in memory? |
I've been having similar issues with SSKeychain under iOS 7 and now 8. I log out the keychain item and it returns null causing the login screen to be revealed again. Wonder if anyone else has seen a similar issue? |
I have never had this problem. Have you tried logging errors on save to see if the save is unsuccessful? |
The keychain item seems to be saving correctly as within my app the keychain is used straight away to call our API. It seems to happen after a few uses of the app which is entirely intermittent. |
I sent an email, but it didn't seem to attach to this chain. I'm still having the problem and the behavior is the same as Andrew's. It saves and can be recalled, but intermittently, I will get an errSecItemNotFound and then have to regenerate the NSUUID. |
I don't think this is an issue with SSKeychain. |
I'm currently working on something else, but I'll try to test by reverting to the last version of SSKeychain and also trying out a different keychain library. |
I'm still having the problem and the behavior is the same as Andrew's. It saves and can be recalled, but every once in a while I get the errSecItemNotFound, even though the last attempt was just fine. Thanks! Sent from my iPhone 5s mikeho // eecs bme 2004 On Fri, Sep 5, 2014 at 12:34 PM, Andrew Yates [email protected]
|
Digging into this more I am wondering if @abc2mit is doing background fetch anywhere? Wondering if the issue is anyway related to... https://blog.loom.com/how-we-fixed-the-ios7-forced-logout-bug-thats-been-plaguing-so-many-apps/ |
@ay8s Hmm... that's an interesting find! Thank you! Yes, I do use background fetch and location updates. But I never would've thought that would be the issue. From what I can tell in the SSKeychain code, all I need to do is do this on launch:
Now for some reason, I'm always getting an OSStatus of |
Okay, then, I decided to clean my build, delete the app from the phone and re-install. Seems to be ok so far. I will let this thread know if that solved the problem. @ay8s thanks for the find! |
I'll still keep this open for a little while longer, but I haven't hit any of my breakpoints that indicate that the data is now lost. It seems like it is now persistent between app reinstalls as well as restarts. Thanks again to @ay8s for finding that bug. It's so odd that it's not really well-documented. I hope that others find this discovery useful. |
Hi, |
Hi, we also put our deviceID in keychain and find our user fetch a nil sometimes. The error code is always |
The change seems to be working. One note is that the documentation (https://developer.apple.com/library/ios/documentation/security/reference/keychainservices/index.html#//apple_ref/doc/constant_group/Keychain_Item_Accessibility_Constants) recommends using |
After a while of testing the app, the fix in this thread fixed the issue. I'm closing this. |
@abc2mit is right, Even apps with background mode enabled will not be launched after a restart. http://stackoverflow.com/questions/20682909/does-ios-start-app-in-background-after-reboot-if-remote-notification-defined-in And as the doc says:
|
So even after having introduced the kSecAttrAccebleAlways in appDidFinishLaunching I am still experience the issue with iOS 8.1.2 |
I have the same issue here with ios 8.4.x and ios 9, I use SSkeychain to store the cipher key of AES, the code almost likes @abc2mit ’s. it's normal at the first beginning, but after a while (maybe ten minutes or longer,could be random time) it's lost and I can not decrypt the data any more. This situation occurred recently and App didn't change anything, how strange it is! |
Hi everyone, i am using UICKeychainStore (another key chain wrapper) and guess what, i am having the same problem on ios9. I think this problem is related to the way keychain is working on iphone. Sometimes keychain returns nil and i cannot seem to simulate it at all. sometimes it works fine for a few runs and then starts returning nil. |
As @rashidasgari points out, this is not an issue with SSKeychain, but an issue with the system Keychain. |
SSKeychain has been working well for almost a year while I'm developing my app. I've run into a problem recently though that I haven't seem to be able to trace. Once in a while (and it seems random at times), the data I store in the keychain will now disappear. I'm not doing anything differently than before, so I'm not sure why the data isn't persisting.
I'm currently on iOS 7.1.1 on an iPhone 5S. Using Xcode6-beta6 and AppCode 3.0.4.
When I check
[SSKeychain allAccounts]
in debug, the array is empty.Here's my code to create a new device ID, for example:
Anyone else see this happening or have some ideas on what might be causing the issue?
The text was updated successfully, but these errors were encountered: