2

I want to keep the user logged-in after the login success in Flutter, I use SharedPreferences to store a boolean as (isLoggedIn = true), but i'm afraid of hacking this operation if someone can access this boolean and change its value from false to true, is this possible?

and if it's how can i secure the keep me logged in value?

Mo Ali
  • 598
  • 6
  • 11
  • 2
    Why not use firebase authentication? It is free and it supports google sign in, email and password sign in, facebook sign in,etc. https://firebase.google.com/pricing and https://www.youtube.com/watch?v=jl5E0UfAGVs&list=PL4cUxeGkcC9j--TKIdkb3ISfRbJeJYQwC&index=12 . You need to import this package: https://pub.dev/packages/firebase_auth. https://pub.dev/packages/flutter_secure_storage is a way of storing data securely. It works like SharedPreferences but is more secure. I would still recommend using firebase auth since its way easier and way more secure and has more functionalities – CoderUni Sep 20 '20 at 13:16
  • Thanks for reply, but i don't use firebase as back-end, i use java and spring which has spring OAuth, i will try flutter_secure_storage – Mo Ali Sep 20 '20 at 13:56
  • It works like secure_storage. I recently made an answered someone who is trying to know more about secure_storage. My answer might help you as well: https://stackoverflow.com/questions/63886883/limitations-of-secure-storage-keychain-and-keystore. Good Luck! (Btw, secure_storage is enough in your situation) – CoderUni Sep 20 '20 at 13:58

0 Answers0