C# 클래스 Candor.Security.SqlProvider.UserProvider

Sql Server implementation of the cs.UserProvider.
The user and user salt tables can be accessed from a different connection than the audit tables if desired for extra security. You may want to store the salt for the users in a separate database server to make it less likely that a hacker would get into both systems and have a means to decrypt the user password hashes. If you do not want to do this or are not able to have the extra databases then just specifify the main 'connectionName' property and it will be used for all the tables. Separate connection names / strings is not typical in other providers. This is a special case for security reasons.
상속: Candor.Security.UserProvider
파일 보기 프로젝트 열기: michael-lang/candor-common

공개 메소드들

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

Initialize ( string name, NameValueCollection config ) : void

Initializes the provider from the configuration values.

UserProvider ( ) : System

Creates a new instance.

UserProvider ( String name, string connectionName ) : System

Creates a new instance with a specific name and a single named connection used for all operations.

UserProvider ( String name, string connectionNameUser, string connectionNameUserSalt, string connectionNameAudit ) : System

Creates a new instance with a separate named connections for each secure area.

UserProvider ( string name ) : System

Creates a new isntance with a specific name. No initialization.

보호된 메소드들

메소드 설명
GetRecentFailedUserNameAuthenticationCount ( string name ) : Int32

Gets the number of times a user name has failed authentication within the configured allowable failure period.

GetSessionAuthenticationHistory ( UserSession session ) : AuthenticationHistory

Gets the authentication history for a specific session.

GetUserSalt ( System.Guid userId ) : UserSalt

Gets a user's salt metadata.

GetUserSession ( System.Guid renewalToken ) : UserSession

Gets a user session by the renewal token.

InsertUserHistory ( AuthenticationHistory history ) : void

Inserts a new user authentication history.

SaveUser ( User user ) : void

Saves a user, insert or update depending if RecordId is non-zero.

SaveUserSalt ( UserSalt salt ) : void

Saves a user salt, insert or update depending if RecordId is non-zero.

SaveUserSession ( UserSession session ) : void

Saves a user session, insert or update.

비공개 메소드들

메소드 설명
BuildUser ( System.Data.SqlClient.SqlDataReader reader ) : User
GetConnectionString ( String name ) : string
InitializeInternal ( string name, NameValueCollection config ) : void

메소드 상세

GetLatestUserSessions() 공개 메소드

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

GetRecentFailedUserNameAuthenticationCount() 보호된 메소드

Gets the number of times a user name has failed authentication within the configured allowable failure period.
protected GetRecentFailedUserNameAuthenticationCount ( string name ) : Int32
name string
리턴 System.Int32

GetSessionAuthenticationHistory() 보호된 메소드

Gets the authentication history for a specific session.
protected GetSessionAuthenticationHistory ( UserSession session ) : AuthenticationHistory
session Candor.Security.UserSession
리턴 Candor.Security.AuthenticationHistory

GetUserByID() 공개 메소드

Gets a user by identity.
public GetUserByID ( System.Guid userId ) : User
userId System.Guid The unique identity.
리턴 Candor.Security.User

GetUserByName() 공개 메소드

Gets a user by name.
public GetUserByName ( string name ) : User
name string The unique sign in name.
리턴 Candor.Security.User

GetUserSalt() 보호된 메소드

Gets a user's salt metadata.
protected GetUserSalt ( System.Guid userId ) : UserSalt
userId System.Guid
리턴 Candor.Security.UserSalt

GetUserSession() 보호된 메소드

Gets a user session by the renewal token.
protected GetUserSession ( System.Guid renewalToken ) : UserSession
renewalToken System.Guid
리턴 Candor.Security.UserSession

Initialize() 공개 메소드

Initializes the provider from the configuration values.
public Initialize ( string name, NameValueCollection config ) : void
name string The name of this provider instance.
config System.Collections.Specialized.NameValueCollection The configuration values.
리턴 void

InsertUserHistory() 보호된 메소드

Inserts a new user authentication history.
protected InsertUserHistory ( AuthenticationHistory history ) : void
history Candor.Security.AuthenticationHistory
리턴 void

SaveUser() 보호된 메소드

Saves a user, insert or update depending if RecordId is non-zero.
protected SaveUser ( User user ) : void
user Candor.Security.User
리턴 void

SaveUserSalt() 보호된 메소드

Saves a user salt, insert or update depending if RecordId is non-zero.
protected SaveUserSalt ( UserSalt salt ) : void
salt Candor.Security.UserSalt
리턴 void

SaveUserSession() 보호된 메소드

Saves a user session, insert or update.
protected SaveUserSession ( UserSession session ) : void
session Candor.Security.UserSession
리턴 void

UserProvider() 공개 메소드

Creates a new instance.
public UserProvider ( ) : System
리턴 System

UserProvider() 공개 메소드

Creates a new instance with a specific name and a single named connection used for all operations.
public UserProvider ( String name, string connectionName ) : System
name String A name for this provider instance, unique for all User Providers.
connectionName string A SQL database connection named defined in configuration.
리턴 System

UserProvider() 공개 메소드

Creates a new instance with a separate named connections for each secure area.
public UserProvider ( String name, string connectionNameUser, string connectionNameUserSalt, string connectionNameAudit ) : System
name String A name for this provider instance, unique for all User Providers.
connectionNameUser string A SQL database connection named defined in configuration; used for the user table only.
connectionNameUserSalt string A SQL database connection named defined in configuration; used for storing user salts only.
connectionNameAudit string A SQL database connection named defined in configuration; used for audit tables.
리턴 System

UserProvider() 공개 메소드

Creates a new isntance with a specific name. No initialization.
public UserProvider ( string name ) : System
name string
리턴 System