-
-
Notifications
You must be signed in to change notification settings - Fork 112
Description
We need a way to force the user to re-authenticate. Because our backend is sometimes very slow, we need a very high AuthenticationValidityDuration. This leads to the problem that if the user logs out or is logged out within the time, he can log in without a new biometric check.
Below in detail:
I am using AuthenticationValidityDuration with 10 seconds for initial token refresh when logging in:
Future<void> login() async{
// will show biometric auth and start 10 second AuthenticationValidity
final oldToken = await storageFile.read();
final refreshedToken = await refreshToken(oldToken)
await storageFile.write(refreshedToken);
}When the backends reacts really fast and user logs out immediately after login, calling login function does not show Biometric Auth to the user, cause 10 second AuthenticationValidity is not over yet.
For this reason I need something like a forceBiometric flag when reading storageFile. This should look like:
Future<void> login() async{
// will always show biometric auth, not depending on AuthenticationValidity
final oldToken = await storageFile.read(forceBiometrichAuth: true);
final refreshedToken = await refreshToken(oldToken)
await storageFile.write(refreshedToken);
}If there is a possibility to handle that scenario without any changes, than my request can be ignored.