Comments (7)
Found this property accessibility: KeychainAccessibility.first_unlock_this_device,
but it doesn't have always accessibility. I think it's a feature request now.
Use case: push is received when phone is locked and just restarted (after power was drained and device is on charge). Callback in push isolate is calling backend to confirm push delivery in our system. Request doesn't have access token.
from flutter_secure_storage.
I'm running into a similar issue, though not from an isolate. I use flutter_background_fetch to periodically update Home Widgets. Part of this update process is to fetch new data for the user from the server (requiring their access/refresh token to be pulled from storage). This seems to fail with the error mentioned in this issue and this one (which seem similar/the same).
It's worth noting that once I return to the app, I go through the same codepath to retrieve the access/refresh tokens and the same error is thrown, so it seems the initial background read borks the storage retrieval entirely until I force-quit the app (swiping up from recents) and start the app again.
In case it helps, the retrieval code looks like:
final accessToken = _storage.read(key: _accessTokenKey);
final refreshToken = _storage.read(key: _refreshTokenKey);
final expiresIn = _storage.read(key: _expiresInKey);
final createdAt = _storage.read(key: _createdAtKey);
final results = await Future.wait(
[accessToken, refreshToken, expiresIn, createdAt],
);
I am using the default iOS keychain options, but it looks like my choices are to change those options to first_unlock
or first_unlock_this_device
OR downgrade to 9.0.0
(not sure why this would help, but there have been reports of it helping...)?
However I read in another issue that while this may allow background access on iOS, Android doesn't support it? That seems like a dealbreaker. Is this still the case @juliansteenbakker?
from flutter_secure_storage.
Hi,
We observe the same issue (in our case this makes the whole app unusable). Are there any other fixes except rolling back the version? Thank you.
from flutter_secure_storage.
Hi,
We observe the same issue (in our case this makes the whole app unusable). Are there any other fixes except rolling back the version? Thank you.
I ended up migrating from one storage type to another (specifically first_unlock_this_device
) to allow background access. Note that you actually need to migrate, you can't just change the iOS keychain access type, otherwise existing users will not be able to retrieve previously saved values.
from flutter_secure_storage.
Related Issues (20)
- Beware the androidx.security:security-crypto is deprecated
- [WEB] Wasm support HOT 2
- onCupertinoProtectedDataAvailabilityChanged listener is not returning any value(true or false) even when isCupertinoProtectedDataAvailable is true HOT 6
- > Failed to transform android.jar to match attributes {artifactType=android-platform-attr, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime}. HOT 2
- InfoSec Documentation for Windows is missing
- Question about files on Windows platform
- Reading a specific key or using read all returns a null from the store HOT 1
- Running on web fails when _selectOptions are called
- Recording with encrypted data
- Linux read always empty
- Cannot compile my project with AGP >=8.0.0 due to R8 error HOT 2
- I am trying to save data but for some reason it is not saved on Flutter web (Chrome)
- app run crash on macos m1 pro HOT 2
- After reopen application, getting null values in IOS. But working in Android. HOT 10
- flutter_secure_storage for web get error: type LegacyJavaScriptObject is not a subtype of FutureOr<CryptoKey> HOT 1
- Error while reading data on windows HOT 1
- SHA-1 is a weak hash known to have hash collisions.
- App uses the encryption mode CBC with PKCS5/PKCS7 padding
- After reopen application, getting null values in IOS. But working in Android HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flutter_secure_storage.