-
-
Notifications
You must be signed in to change notification settings - Fork 433
.read() return null since iOS 16.3.X even with the correct KeychainAccessibility #524
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Glad you opened this issue. |
Any updates? |
I am having the same problem! any updates? |
You can try read it twice as this: I`m not sure if it is a kind of fix for prod but better than nothing :) |
@saibotma are you still alive ? 🤣 |
😱 6 weeks with this bug! How many users are impacted? Answer is in official documentation. There is a delay before protected data availability. You can check protected data availability before accessing it. And, if protected data is not available, you can wait for notification. And be sure to use the good protection level. And avoid access from main thread.
|
Is there anything else? Currently, there is no solution to the problem... |
@VB10 If you wait for notification of availability when protected data is unavailable, keychain will return value instead of null. |
When my users try to open from the lock screen, it returns to null, so it shows the latetly. Could you please let me know if you have any ideas about this issue. I've tried a lot of solutions, but nothing works. @florentmorin |
Phone status: Locked When tapping on notification, it wasn't able to read data from the secure storage while application starting. For now we have updated accessibility options for IOS as following. final _storage = const FlutterSecureStorage(
iOptions: IOSOptions(accessibility: KeychainAccessibility.first_unlock),
);
} While the application is starting, it reads data from the secure storage. |
You must verify that secured data is available by using dedicated function. Keychain must be accessible after first unlock if you read it from background task. And keychain mustn't be read from main thread. |
@stefanschaller did you manage to work around this somehow? |
@flodaniel I fixed it by one of the following methods. (Two different projects).
|
Do you guys know how to reproduce this issue? Only one colleague of mine can reproduce this issue once in a day or two and he is not a developer. He just opens the app and the issue occurs. |
I looked in the code and saw that the accessibility setting is ignored when reading or deleting values. It could also have an influence on writing data. I forked the repo and fixed that issue. Also, I changed the response type of most of the native methods, so now you get an PlatformException if the keychain operations failed. The exception contains the OSStatus code and the description provided by the operating system. This should make the logging and debugging much easier. This additions combined with custom plugin to check when keychain is available fixed the problem for me. Fork is available under https://github.com/bierbaumtim/flutter_secure_storage . I hope this helps some of you. |
Package version:
flutter_secure_storage: ^8.0.0
Flutter:
I have the following code:
Regarding this question, the mode looks correct, but I just receive a null token when the app was moved into the background (not terminated) and the user locks the device.
https://stackoverflow.com/questions/10536859/ios-keychain-not-retrieving-values-from-background
Thanks for the support.
The text was updated successfully, but these errors were encountered: