public static HttpCookie GetFormsAuthenticationCookie(AuthorizationInfoDTO authorizationInfoDTO) { HttpCookie formsAuthenticationTicketCookie; DateTime cookieIssuedDate = DateTime.Now; var ticket = new FormsAuthenticationTicket(0, authorizationInfoDTO.User.UserName, cookieIssuedDate, cookieIssuedDate.AddMinutes(FormsAuthentication.Timeout.TotalMinutes), false, authorizationInfoDTO.Token.TokenString, FormsAuthentication.FormsCookiePath); string encryptedCookieContent = FormsAuthentication.Encrypt(ticket); formsAuthenticationTicketCookie = new HttpCookie(FormsAuthentication.FormsCookieName, encryptedCookieContent) { Domain = FormsAuthentication.CookieDomain, Path = FormsAuthentication.FormsCookiePath, HttpOnly = true, Secure = FormsAuthentication.RequireSSL }; return formsAuthenticationTicketCookie; }
public EgasIdentity(AuthorizationInfoDTO authData) { this.AuthData = authData; }