C# Класс 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.
Показать файл Открыть проект

Открытые методы

Метод Описание
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.

Описание методов

AuthenticateUser() публичный статический Метод

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.
Результат UserIdentity

AuthenticateUser() публичный статический Метод

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.
Результат UserIdentity

GenerateUserResetCode() публичный статический Метод

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.
Результат String

GetLatestUserSessions() публичный статический Метод

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.
Результат List

GetUserByID() публичный статический Метод

Gets a user by identity.
public static GetUserByID ( System.Guid userID ) : User
userID System.Guid The unique identity.
Результат User

GetUserByName() публичный статический Метод

Gets a user by name.
public static GetUserByName ( string name ) : User
name string The unique sign in name.
Результат User

InvalidateSession() публичный статический Метод

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
Результат void

RegisterUser() публичный статический Метод

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.
Результат UserIdentity

UpdateUser() публичный статический Метод

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.
Результат bool

ValidateEmailAddressFormat() публичный статический Метод

Validates that a string is a valid email address format.
public static ValidateEmailAddressFormat ( string emailAddress ) : bool
emailAddress string
Результат bool

ValidateName() публичный статический Метод

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.
Результат bool

ValidatePassword() публичный статический Метод

Validates that a password meets minimum requirements.
public static ValidatePassword ( string password, ExecutionResults results ) : bool
password string
results ExecutionResults
Результат bool