quick poll, do you store access/refresh tokens in ...
# android-architecture
u
quick poll, do you store access/refresh tokens in shared prefs or sqlite?
w
(Previous answer was wrong. See longer answer below 🙂 )
j
If you want your token stolen I guess you can use both 😄
I would use the new security library for that
anyway if you would use shared prefs make sure you make it async (as you are doing disk i/o)
🙏 1
🙏 1
s
Store them in encrypted shared prefs. And, depending on our client, guarded by a biometric prompt.
b
I would say use shared pref for faster access compared to sqlite. Plus as per your requirement your value looks like key-value pair, which will keep on getting updated. For adding security use encryption before saving.
u
I have it in shared prefs too, but contemplating putting in sqlite, since I alraedy have it for actual data .. and would get transactions, migrations etc ..not worth it?
w
… actually, I dug into this a bit, and turns out we’re using the AccountManager. We’re not storing the tokens ourselves- we’re letting them be managed by Google, connected to the account we create for the user as part of onboarding.
u
im not really fan of that, unless you have multiple apps using the same account; since that will survive app uninstall