Ejemplo n.º 1
0
 private void handlePassword(UserViewModel input, User origional)
 {
     if (input.Password.IsNotEmpty())
     {
         var loginInfo = origional.UserLoginInfo;
         loginInfo.Salt = _securityDataService.CreateSalt();
         loginInfo.Password = _securityDataService.CreatePasswordHash(input.Password,
                                                     loginInfo.Salt);
     }
 }
 public string ThisUserHasBeenAuthenticated(User user,  bool rememberMe)
 {
     string userData = String.Empty;
     userData = userData + "UserId=" + user.EntityId + "|OrgId=" + user.OrgId;
     var ticket = new FormsAuthenticationTicket(1, user.FullNameLNF, DateTime.Now, DateTime.Now.AddMinutes(30),
                                                rememberMe, userData);
     string encTicket = FormsAuthentication.Encrypt(ticket);
     var faCookie = new HttpCookie(FormsAuthentication.FormsCookieName, encTicket);
     HttpContext.Current.Response.Cookies.Add(faCookie);
     return FormsAuthentication.GetRedirectUrl(user.FullNameLNF, false);
 }
Ejemplo n.º 3
0
 private void createUser()
 {
     var salt = _securityDataService.CreateSalt();
     var passwordHash = _securityDataService.CreatePasswordHash("123", salt);
     _defaultUser = new User
                        {
                            FirstName = "Raif",
                            LastName = "Harik"
                        };
     _defaultUser.UserLoginInfo = new UserLoginInfo
                                      {
                                          LoginName = "Admin",
                                          Password = passwordHash,
                                          Salt = salt
                                      };
     _repository.Save(_defaultUser);
 }
Ejemplo n.º 4
0
 private void mapCollections(User origional, UserViewModel input)
 {
 }