flutter_secure_storage
flutter_secure_storage copied to clipboard
iOS: stored values are persisted even after app was removed
Repro steps:
- Make sure you have only one bundle/flavor of the app on the device.
- Store some key-value pair, like
authToken - Remove the app
- Install a fresh copy of the app
- The stored value is somehow accessible
Check here: https://github.com/mogol/flutter_secure_storage/issues/125
It's the expected behavior of iCloud Keychain. It's kind of like a password manager where each app has its own private space.
If you want to delete, you can run a delete function from the app which deletes everything.
Going by this StackOverflow answer https://stackoverflow.com/questions/42903633/store-item-in-ios-keychain-without-icloud-sync/42903918#42903918 and this block of code in the iOS plugin code:
let update: [CFString: Any?] = [
kSecValueData: value.data(using: String.Encoding.utf8),
kSecAttrAccessible: attrAccessible,
kSecAttrSynchronizable: synchronizable
]
anything stored via FlutterSecureStorage should not be synchronized with iCloud (by default). As the flag defaults to false.
Maybe I'm reading this wrong or maybe it't not working as intended. The "solution" to manually remove all keys depending on some arbitrary flag seems rather hacky.
Since this is still default behavior, i am closing this issue.