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.
파일 보기 프로젝트 열기: michael-lang/candor-common

공개 메소드들

메소드 설명
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