DatabaseUserAuthenticator class
Uses a DatabaseRepository and a UserAuthenticationGenerator
to automatically create and verify users.
Constructors
- DatabaseUserAuthenticator({required DatabaseRepository database, required String authenticationDatabase, required UserAuthenticationGenerator authenticationGenerator, required AuthenticationSecretsRepository secretsRepository})
-
database,authenticationDatabaseare both used to determine where to save and find the stored UserAuthentication
Properties
- authenticationDatabase → String
-
The name of the database where the UserAuthentications will be stored
final
- authenticationGenerator → UserAuthenticationGenerator
-
Generates and Authenticates UserAuthentications with and against the
base Passwords
final
- database → DatabaseRepository
-
The
DatabaseRepositorywhere the UserAuthentications will be storedfinal - hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- secretsRepository → AuthenticationSecretsRepository
-
Holds and can automatically generate the AuthenticationSecretsModel
needed for the hashing part of this
final
Methods
-
confirmPassword(
UserModel model, String basePassword) → Future< bool> -
Confirms if the given
basePasswordis the correct password for the givenmodel. -
deleteUserAuthentication(
UserModel model) → Future< bool> -
Deletes the UserAuthentication for the given
modelif it exists in authenticationDatabase -
findUserAuthentication(
UserModel model) → Future< UserAuthentication?> -
Finds the UserAuthentication for the given
modelif it exists in authenticationDatabase -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
saveUserAuthentication(
UserModel model, String basePassword) → Future< void> -
Saves a new UserAuthentication for the given
modelwithbasePasswordas the way to confirm it. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited