C# Class Contrive.Auth.Web.FormsAuthService

Inheritance: IFormsAuthService
Show file Open project: alanstevens/Contrive

Private Properties

Property Type Description
GetCurrentCookie System.Web.HttpCookie
NewTicketFrom System.Web.Security.FormsAuthenticationTicket
RenewCookieWith void
ValidateCookie bool
ValidatePrincipal bool

Public Methods

Method Description
FormsAuthService ( IUserService userService ) : System
GetUpdatedPrincipalFor ( IPrincipal principal ) : IPrincipal

To be called on post authenticate request with Application.User

GetUpdatedPrincipalFor ( IUser user, bool stayLoggedIn = false, System.Web.Security.FormsAuthenticationTicket currentTicket = null ) : IPrincipal

Protected Methods

Method Description
DeserializeUser ( string userData, string userName ) : IUser
GetCurrentTicket ( string encryptedTicketValue ) : System.Web.Security.FormsAuthenticationTicket
SerializeUser ( IUser user ) : string

Private Methods

Method Description
GetCurrentCookie ( ) : System.Web.HttpCookie
NewTicketFrom ( string userName, System.DateTime issueDate, System.DateTime expires, bool stayLoggedIn, string userData ) : System.Web.Security.FormsAuthenticationTicket
RenewCookieWith ( System.Web.Security.FormsAuthenticationTicket ticket ) : void
ValidateCookie ( System.Web.HttpCookie authCookie ) : bool
ValidatePrincipal ( IPrincipal principal ) : bool

Method Details

DeserializeUser() protected method

protected DeserializeUser ( string userData, string userName ) : IUser
userData string
userName string
return IUser

FormsAuthService() public method

public FormsAuthService ( IUserService userService ) : System
userService IUserService
return System

GetCurrentTicket() protected static method

protected static GetCurrentTicket ( string encryptedTicketValue ) : System.Web.Security.FormsAuthenticationTicket
encryptedTicketValue string
return System.Web.Security.FormsAuthenticationTicket

GetUpdatedPrincipalFor() public method

To be called on post authenticate request with Application.User
public GetUpdatedPrincipalFor ( IPrincipal principal ) : IPrincipal
principal IPrincipal
return IPrincipal

GetUpdatedPrincipalFor() public method

public GetUpdatedPrincipalFor ( IUser user, bool stayLoggedIn = false, System.Web.Security.FormsAuthenticationTicket currentTicket = null ) : IPrincipal
user IUser
stayLoggedIn bool
currentTicket System.Web.Security.FormsAuthenticationTicket
return IPrincipal

SerializeUser() protected method

protected SerializeUser ( IUser user ) : string
user IUser
return string