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, authenticationDatabase are 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 DatabaseRepository where the UserAuthentications will be stored
final
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 basePassword is the correct password for the given model.
deleteUserAuthentication(UserModel model) Future<bool>
Deletes the UserAuthentication for the given model if it exists in authenticationDatabase
findUserAuthentication(UserModel model) Future<UserAuthentication?>
Finds the UserAuthentication for the given model if 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 model with basePassword as the way to confirm it.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited