C# Class EnterpriseWebLibrary.EnterpriseWebFramework.UserManagement.FormsAuthStatics

Statics related to forms authentication.
Show file Open project: enduracode/enterprise-web-library Class Usage Examples

Public Properties

Property Type Description
SessionDuration System.TimeSpan

Private Properties

Property Type Description
GetFormsAuthTicket System.Web.Security.FormsAuthenticationTicket
GetUser EnterpriseWebLibrary.EnterpriseWebFramework.UserManagement.FormsAuthCapableUser
GetUser EnterpriseWebLibrary.EnterpriseWebFramework.UserManagement.FormsAuthCapableUser
GetUsers IEnumerable
Init void
SendPassword void
UpdateFormsAuthCookieIfNecessary void
addStatusMessageIfClockNotSynchronized void
clearFormsAuthCookie void
setCookie void
setFormsAuthCookie void
setFormsAuthCookieAndUser void
setUpClientSideLogicForLogIn void
verifyTestCookie string[]

Public Methods

Method Description
GetEmailAddressFormItem ( this emailAddress, FormItemLabel label, string errorMessage, ValidationList vl ) : FormItem

Gets an email address form item for use on log-in pages. The validation sets this data value to the post back value of the text box, if valid, or adds the specified error message to the form item.

GetLogInMethod ( Control etherealControlParent, DataValue emailAddress, DataValue password, string emailAddressErrorMessage, string passwordErrorMessage, ValidationList vl ) : Func

Sets up client-side logic for user log-in and returns a modification method that logs in a user. Do not call if the system does not implement the forms-authentication-capable user-management provider.

GetSpecifiedUserLogInMethod ( Control etherealControlParent, ValidationList vl ) : Action

Sets up client-side logic for user log-in and returns a modification method that logs in the specified user. Do not call if the system does not implement the forms-authentication-capable user-management provider. This method should be called in LoadData. The method returned should be called in an event handler.

LogOutUser ( ) : void

Do not call if the system does not implement the forms authentication capable user management provider.

ResetAndSendPassword ( int userId ) : void

Resets the password of the given user and sends a message with the new password to their email address. Do not call if the system does not implement the forms authentication capable user management provider.

ResetAndSendPassword ( string validatedEmailAddress, string emailAddressErrorMessage ) : void

Resets the password of the user with the specified email address and sends a message with the new password to their email address. Do not call if the system does not implement the forms authentication capable user management provider.

UserCredentialsAreCorrect ( string userEmailAddress, string providedPassword ) : bool

PRE: SystemProvider is a FormsAuthCapableUserManagementProvider. Returns true if the given credentials correspond to a user and are correct.

ValidatePassword ( Validator validator, DataValue password, DataValue passwordAgain ) : void

Ensures that the specified data values contain identical, valid password values.

Private Methods

Method Description
GetFormsAuthTicket ( System.Web.HttpCookie cookie ) : System.Web.Security.FormsAuthenticationTicket
GetUser ( int userId, bool ensureUserExists ) : EnterpriseWebLibrary.EnterpriseWebFramework.UserManagement.FormsAuthCapableUser
GetUser ( string emailAddress ) : EnterpriseWebLibrary.EnterpriseWebFramework.UserManagement.FormsAuthCapableUser
GetUsers ( ) : IEnumerable
Init ( Func providerGetter ) : void
SendPassword ( string emailAddress, string password ) : void
UpdateFormsAuthCookieIfNecessary ( ) : void
addStatusMessageIfClockNotSynchronized ( DataValue utcOffset ) : void
clearFormsAuthCookie ( ) : void
setCookie ( string name, string value ) : void
setFormsAuthCookie ( System.Web.Security.FormsAuthenticationTicket ticket ) : void
setFormsAuthCookieAndUser ( EnterpriseWebLibrary.EnterpriseWebFramework.UserManagement.FormsAuthCapableUser user ) : void
setUpClientSideLogicForLogIn ( Control etherealControlParent, DataValue utcOffset, ValidationList vl ) : void
verifyTestCookie ( ) : string[]

Method Details

GetEmailAddressFormItem() public static method

Gets an email address form item for use on log-in pages. The validation sets this data value to the post back value of the text box, if valid, or adds the specified error message to the form item.
public static GetEmailAddressFormItem ( this emailAddress, FormItemLabel label, string errorMessage, ValidationList vl ) : FormItem
emailAddress this
label FormItemLabel
errorMessage string
vl ValidationList
return FormItem

GetLogInMethod() public static method

Sets up client-side logic for user log-in and returns a modification method that logs in a user. Do not call if the system does not implement the forms-authentication-capable user-management provider.
public static GetLogInMethod ( Control etherealControlParent, DataValue emailAddress, DataValue password, string emailAddressErrorMessage, string passwordErrorMessage, ValidationList vl ) : Func
etherealControlParent System.Web.UI.Control
emailAddress DataValue
password DataValue
emailAddressErrorMessage string
passwordErrorMessage string
vl ValidationList
return Func

GetSpecifiedUserLogInMethod() public static method

Sets up client-side logic for user log-in and returns a modification method that logs in the specified user. Do not call if the system does not implement the forms-authentication-capable user-management provider. This method should be called in LoadData. The method returned should be called in an event handler.
public static GetSpecifiedUserLogInMethod ( Control etherealControlParent, ValidationList vl ) : Action
etherealControlParent System.Web.UI.Control
vl ValidationList
return Action

LogOutUser() public static method

Do not call if the system does not implement the forms authentication capable user management provider.
public static LogOutUser ( ) : void
return void

ResetAndSendPassword() public static method

Resets the password of the given user and sends a message with the new password to their email address. Do not call if the system does not implement the forms authentication capable user management provider.
public static ResetAndSendPassword ( int userId ) : void
userId int
return void

ResetAndSendPassword() public static method

Resets the password of the user with the specified email address and sends a message with the new password to their email address. Do not call if the system does not implement the forms authentication capable user management provider.
public static ResetAndSendPassword ( string validatedEmailAddress, string emailAddressErrorMessage ) : void
validatedEmailAddress string
emailAddressErrorMessage string
return void

UserCredentialsAreCorrect() public static method

PRE: SystemProvider is a FormsAuthCapableUserManagementProvider. Returns true if the given credentials correspond to a user and are correct.
public static UserCredentialsAreCorrect ( string userEmailAddress, string providedPassword ) : bool
userEmailAddress string
providedPassword string
return bool

ValidatePassword() public static method

Ensures that the specified data values contain identical, valid password values.
public static ValidatePassword ( Validator validator, DataValue password, DataValue passwordAgain ) : void
validator Validator
password DataValue
passwordAgain DataValue
return void

Property Details

SessionDuration public static property

The idle time required for a session to be erased.
public static TimeSpan,System SessionDuration
return System.TimeSpan