protected User GetUser(SimpleAuthenticationTicket Ticket, SessionData Data) { UserIdentity identity = new UserIdentity(Ticket.UserName, Data.UserId, Data.UserDisplayName, Data.Roles); return new User(identity); }
protected string EncryptUser(User User, bool KeepLoggedIn) { SimpleAuthenticationTicket ticket = new SimpleAuthenticationTicket(User.Identity.Name, DateTime.Now, DateTime.Now.AddDays(SettingsManager.AuthenticationSettings.DaysToExpiration), KeepLoggedIn); return ticket.Encrypt(); }