authpass / biometric_storage

Flutter plugin to store data behind biometric authentication (ie. fingerprint)
https://pub.dev/packages/biometric_storage
MIT License
184 stars 107 forks source link

What is the maximum value for authenticationValidityDurationSeconds? #112

Open abdallah-odeh opened 8 months ago

abdallah-odeh commented 8 months ago

What is the maximum value I can set for authenticationValidityDurationSeconds? I set it to 60 minutes but it's not working as expected! when this hour is over the user is not prompted to authenticate

my use case: I am using biometric_storage to store the refresh_token for the user my access token age is 15 minutes, & setting the authenticationValidityDurationSeconds to -1 will prompt the user to authenticate in every transaction (read & write) and it is very bad UX to be using the app & suddenly a fingerprint prompt! so what I have done is making the duration an hour, and during this hour I have my logic to check if the user really must authenticate or not when the hour is over, I don't prompt anything and rely on this plugin, but the data is read & retrieved without a biometric authentication!

so

  1. What is the maximum duration for authenticationValidityDurationSeconds?
  2. Is there a better way to implement this using only this plugin? (making the biometric prompt depending on the transaction not the storage file)?

thanks in advance