Package org.springframework.security.authentication.encoding

Examples of org.springframework.security.authentication.encoding.Md5PasswordEncoder.encodePassword()


            UserUtil.permissionCheck("update_system");
            User originalUser = baseService.getEntityById(User.class,
                    user.getId());
            String oldPassword = originalUser.getPassword();
            if (!oldPassword.equalsIgnoreCase(user.getPassword())) {
                user.setPassword(encoder.encodePassword(user.getPassword(),
                        AuthenticationFilter.SALT));
            }
            user.setRoles(originalUser.getRoles());
            user.setTargetLists(originalUser.getTargetLists());
            user.setCalls(originalUser.getCalls());
View Full Code Here


            user.setMeetings(originalUser.getMeetings());
            user.setCreated_on(originalUser.getCreated_on());
            user.setCreated_by(originalUser.getCreated_by());
        } else {
            UserUtil.permissionCheck("create_system");
            user.setPassword(encoder.encodePassword(user.getPassword(),
                    AuthenticationFilter.SALT));
        }
        super.updateBaseInfo(user);
    }
View Full Code Here

        ActionContext context = ActionContext.getContext();
        Map<String, Object> session = context.getSession();
        User loginUser = (User) session
                .get(AuthenticationSuccessListener.LOGIN_USER);
        Md5PasswordEncoder encoder = new Md5PasswordEncoder();
        String encodePassword = encoder.encodePassword(oldPassword,
                AuthenticationFilter.SALT);
        if (!encodePassword.equals(loginUser.getPassword())) {
            this.addActionError(this
                    .getText("changePassword.wrong.oldPassword"));
            return INPUT;
View Full Code Here

        if (!encodePassword.equals(loginUser.getPassword())) {
            this.addActionError(this
                    .getText("changePassword.wrong.oldPassword"));
            return INPUT;
        }
        encodePassword = encoder.encodePassword(newPassword,
                AuthenticationFilter.SALT);
        loginUser.setPassword(encodePassword);
        baseService.makePersistent(loginUser);
        this.addActionError(this.getText("changePassword.password.success"));
        return SUCCESS;
View Full Code Here

            String newPassword = CommonUtil.randomString(6);

            // Saves the new password
            User user = users.get(0);
            Md5PasswordEncoder encoder = new Md5PasswordEncoder();
            user.setPassword(encoder.encodePassword(newPassword,
                    AuthenticationFilter.SALT));
            this.makePersistent(user);

            // Sends the new password to user
            mailService.sendSystemSimpleMail(email, subject, content
View Full Code Here

        request.getSession().setAttribute("locale", localValue);
        Locale.setDefault(locale);

        User user = UserUtil.getUser(username);
        Md5PasswordEncoder encoder = new Md5PasswordEncoder();
        password = encoder.encodePassword(password, AuthenticationFilter.SALT);
        if (user == null || !user.getPassword().equals(password)) {
            ResourceBundle rb = CommonUtil.getResourceBundle();
            String errorMessage = rb.getString("error.login.denied");
            throw new AuthenticationServiceException(errorMessage);
        }
View Full Code Here


  public String getMD5EncodedPasswordHash(String pass) {
    try {
      PasswordEncoder encoder = new Md5PasswordEncoder();
      String hashedPass = encoder.encodePassword(pass, null);
      return hashedPass.toLowerCase();
    }
    catch (Exception e) {

    }
View Full Code Here

  @Override
  public String encodePassword(String rawPass, Object salt) {
    try {
      PasswordEncoder encoder = new Md5PasswordEncoder();
      String hashedPass = encoder.encodePassword(rawPass, null);
      return hashedPass.toLowerCase();
    }
    catch (Exception e) {

    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.