Flutter for web how to store credentials?

2,422

Solution 1

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.

Solution 2

You can use this package Seems to me it supports both web and android https://pub.dev/packages/password_credential

Share:
2,422
Stecco
Author by

Stecco

Great and enthusiast programmer. Programming Languages known: Java(3 years of development) Python(2 years of development) C++(1 year of development) C#(3 years of development) JS(3 years of development) Frameworks known: NodeJS(2 years of development) JFoenix(1 year of development) D3.js(1 year of development) JxInput(1 year of development) Other: Android(2 years of development) Unity(3 years of development) MySQL(1 years of development) MongoDB(1 years of development) HTML(3 years of development) CSS(3 years of development) Languages Known: Italian(Mother Tongue) English Spanish

Updated on December 12, 2022

Comments

  • Stecco
    Stecco over 1 year

    I am building a Flutter For Web Application that needs to store the credentials in a secure way, to allow the user to automatically login, how can i achive this?