Table of Contents

IUserManager Interface

Provides the APIs for managing users in the database.

Syntax

Unit: Sphinx.UserManager

IUserManager = interface(IInterface);

Methods

Name Description
AccessFailed Notifies a failed user login, incrementing the access failed count.
AddPassword Adds a new password for a user, if there is no current password set.
BeginResetPassword Exchanges a password reset token by a change password token.
ChangeEmail Changes the user email, using the provided email change token.
ChangePassword Changes the user password to a new value, using the provided password change token.
ChangePhoneNumber Changes the user phone number, using the provided phone number change token.
CheckPassword Returns a boolean value indicating if Password is the correct password for the specified User.
ConfirmEmail Sets the user e-mail as confirmed, using the provided confirmation token.
ConfirmPhoneNumber Sets the user phone number as confirmed, using the provided confirmation token.
CreateUser Overloaded
CreateUser(TUser)
CreateUser(TUser, string)
CreateUserInstance Creates a new user object instance.
DeleteUser Deletes the specified user from the database.
FindByEmail Retrieves the user with the specified e-mail, or nil if no user is found.
If two or more users are found with same e-mail, an exception will be raised, that is why you should only call this method if RequireUniqueEmail is set to true in options.
found.
FindById Retrieves the user with the provided id, or nil if no user is found.
FindByName Retrieves the user with the specified user name, or nil if no user is found.
FindByPhoneNumber Retrieves the user with the specified phone number, or nil if no user is found.
If two or more users are found with same phone number, an exception will be raised.
GenerateChange​Email​Token Generates an email change token that should be used to change the e-mail of a user.
GenerateChange​Phone​Number​Token Generates a phone number change token that should be used to change the phone number of a user.
GenerateEmail​Confirmation​Token Generates an email confirmation token that should be used to set the email as confirmed.
GeneratePassword​Change​Token Generates a password change token that should be used to change the user password.
GeneratePassword​Reset​Token Generates a password reset token that should be used to reset the user password.
GeneratePhone​Number​Confirmation​Token Generates a phone number confirmation token that should be used to set the phone number as confirmed.
GenerateUserToken Generates a token for the given user and purpose.
GetAuthentication​Token Returns an authentication token for a user from the database.
GetAuthenticatorKey Returns the authenticator key for the user.
GetTwoFactorEnabled Returns a flag indicating whether the specified user has two factor authentication enabled or not.
GetTwoFactorRequired Returns a flag indicating whether the specified user has two factor authentication required for login.
IsLockedOut Returns a flag indicating whether the specified user is locked out.
RemoveAuthentication​Token Removes an authentication token for a user from the database.
ResetAccessFailed​Count Resets the access failed count to zero for the specified user.
ResetAuthenticatorKey Resets the authenticator key for the user.
SetAuthentication​Token Saves an authentication token for a user in the database.
SetTwoFactorEnabled Sets a flag indicating whether the specified user has two factor authentication enabled or not.
SetTwoFactorRequired Sets a flag indicating whether the specified user must use two factor authentication to login. A null value means the default behavior will be used.
UpdateUser Updates the specified user in the database.
VerifyTwoFactorToken Verifies the specified two factor authentication token for the given user.
VerifyUserToken Returns a flag indicating whether the specified token is valid for the given user and purpose.