C# Class Candor.Security.UserManager

The user manager is a singleton access point to get to the collection of configured UserProvider. If the providers are already configured via code configuration then this manager class will get the providers from there. If they are not configured by code then the providers must be defined in the configuration file for the AppDomain.
Afficher le fichier Open project: michael-lang/candor-common

Méthodes publiques

Méthode Description
AuthenticateUser ( string token, UserSessionDurationType duration, String ipAddress, ExecutionResults result ) : UserIdentity

Authenticates against the data store and returns a UserIdentity given a token returned from a previous authentication.

AuthenticateUser ( string name, string password, UserSessionDurationType duration, string ipAddress, ExecutionResults result ) : UserIdentity

Authenticates against the data store and returns a UserIdentity given a user name, and password.

GenerateUserResetCode ( String name ) : String

Generates a new password reset code for a user and stores that as the current code valid for the next hour.

GetLatestUserSessions ( System.Guid userId, Int32 take ) : List

Gets the latest session(s) for a given user.

GetUserByID ( System.Guid userID ) : User

Gets a user by identity.

GetUserByName ( string name ) : User

Gets a user by name.

InvalidateSession ( string token, String ipAddress, ExecutionResults result ) : void

Invalidates a session token so it can no longer be used.

RegisterUser ( User user, UserSessionDurationType duration, String ipAddress, ExecutionResults result ) : UserIdentity

Registers a new user. The PasswordHash property should be the actual password.

UpdateUser ( User item, String currentPassword, String ipAddress, ExecutionResults result ) : bool

updates a user's name and/or password.

ValidateEmailAddressFormat ( string emailAddress ) : bool

Validates that a string is a valid email address format.

ValidateName ( string name, ExecutionResults result ) : bool

Validates that the specified name meets minimum requirements.

ValidatePassword ( string password, ExecutionResults results ) : bool

Validates that a password meets minimum requirements.

Method Details

AuthenticateUser() public static méthode

Authenticates against the data store and returns a UserIdentity given a token returned from a previous authentication.
public static AuthenticateUser ( string token, UserSessionDurationType duration, String ipAddress, ExecutionResults result ) : UserIdentity
token string The unique token.
duration UserSessionDurationType The amount of time that the renewed token will be valid.
ipAddress String The internet address where the user is connecting from.
result ExecutionResults A ExecutionResults instance to add applicable /// warning and error messages to.
Résultat UserIdentity

AuthenticateUser() public static méthode

Authenticates against the data store and returns a UserIdentity given a user name, and password.
public static AuthenticateUser ( string name, string password, UserSessionDurationType duration, string ipAddress, ExecutionResults result ) : UserIdentity
name string The unique user name.
password string The matching password.
duration UserSessionDurationType The amount of time that the issued token will be valid.
ipAddress string The internet address where the user is connecting from.
result ExecutionResults A ExecutionResults instance to add applicable /// warning and error messages to.
Résultat UserIdentity

GenerateUserResetCode() public static méthode

Generates a new password reset code for a user and stores that as the current code valid for the next hour.
public static GenerateUserResetCode ( String name ) : String
name String The user name / email address.
Résultat String

GetLatestUserSessions() public static méthode

Gets the latest session(s) for a given user.
public static GetLatestUserSessions ( System.Guid userId, Int32 take ) : List
userId System.Guid The unique identity.
take System.Int32 The maximum number of sessions to retrieve.
Résultat List

GetUserByID() public static méthode

Gets a user by identity.
public static GetUserByID ( System.Guid userID ) : User
userID System.Guid The unique identity.
Résultat User

GetUserByName() public static méthode

Gets a user by name.
public static GetUserByName ( string name ) : User
name string The unique sign in name.
Résultat User

InvalidateSession() public static méthode

Invalidates a session token so it can no longer be used.
public static InvalidateSession ( string token, String ipAddress, ExecutionResults result ) : void
token string
ipAddress String
result ExecutionResults
Résultat void

RegisterUser() public static méthode

Registers a new user. The PasswordHash property should be the actual password.
public static RegisterUser ( User user, UserSessionDurationType duration, String ipAddress, ExecutionResults result ) : UserIdentity
user User A user with a raw password which is turned into a password hash as part of registration.
duration UserSessionDurationType The amount of time that the initial session will be valid.
ipAddress String The internet address where the user is connecting from.
result ExecutionResults A ExecutionResults instance to add applicable /// warning and error messages to.
Résultat UserIdentity

UpdateUser() public static méthode

updates a user's name and/or password.
public static UpdateUser ( User item, String currentPassword, String ipAddress, ExecutionResults result ) : bool
item User The user details to be saved. If Password is empty is it not changed. If specified it should be the new raw password (not a hash).
currentPassword String The current raw password for the user used to authenticate that the change can be made.
ipAddress String The internet address where the user is connecting from.
result ExecutionResults A ExecutionResults instance to add applicable /// warning and error messages to.
Résultat bool

ValidateEmailAddressFormat() public static méthode

Validates that a string is a valid email address format.
public static ValidateEmailAddressFormat ( string emailAddress ) : bool
emailAddress string
Résultat bool

ValidateName() public static méthode

Validates that the specified name meets minimum requirements.
public static ValidateName ( string name, ExecutionResults result ) : bool
name string The desired name/alias.
result ExecutionResults Any error messages about the desired name.
Résultat bool

ValidatePassword() public static méthode

Validates that a password meets minimum requirements.
public static ValidatePassword ( string password, ExecutionResults results ) : bool
password string
results ExecutionResults
Résultat bool