Flutter for web how to store credentials? Flutter for web how to store credentials? dart dart

Flutter for web how to store credentials?


In typical web applications (whether flutter_web or not), it is not wise to actually store the user's password in the browser in a cookie or in html storage. One technique some use is to have a persistent cookie that stores the username and a temporary authentication token of some kind that is encrypted with a private key. The authentication token is temporary but exists on the user record in the database and can be used during the time it is allowed to be valid in place of the user's password. This way the user's credentials aren't persisted in the web browser - only the username and the token in an encrypted, persistent cookie.

From what appears to be in the dev preview of Flutter web is that it produces web applications, and I am assuming that standard web development techniques for user security for any and all web applications should be used.


You can use this packageSeems to me it supports both web and androidhttps://pub.dev/packages/password_credential