mogol / flutter_secure_storage

A Flutter plugin to store data in secure storage
https://pub.dartlang.org/packages/flutter_secure_storage
BSD 3-Clause "New" or "Revised" License
1.09k stars 340 forks source link

Also set kSecUseDataProtectionKeychain on read for macos #712

Closed gnunicorn closed 1 month ago

gnunicorn commented 1 month ago

We were experiencing problems when using synchronizable: false on our Mac setup. After some investigation I found out that despite successfully able to write, even immediately after, the read would not return the updated value. Turns out that setting kSecUseDataProtectionKeychain on write also means we need to set that on read or the value isn't properly found. The docs also recommend setting it to true always and we are doing that on write already, but weren't on the query.

This patch sets that key to true regardless of synchronizable being set fixing the issue for us.

juliansteenbakker commented 1 month ago

Thank you for your contribution!