Package org.springframework.security.crypto.password

Examples of org.springframework.security.crypto.password.StandardPasswordEncoder.matches()


  }

  public boolean checkPassword(final String rawPassword,
      final String encodedPassword) {
    final StandardPasswordEncoder encoder = new StandardPasswordEncoder();
    return encoder.matches(rawPassword, encodedPassword);
  }

  public void registerPayer(final PayerDTO payer) {
    try {
      LOGGER.info("Payer registration process start");
View Full Code Here


    }

    private boolean verifyPassword(String username, String presentedPassword,
            String encodedPassword) {
        PasswordEncoder passwordEncoder = new StandardPasswordEncoder(username);
        if (passwordEncoder.matches(presentedPassword, encodedPassword)) {
            return true;
        } else {
            return false;
        }
    }
View Full Code Here

                        throw new CapMessageException(CapAppContext.getMessage(
                                "error.005", new Object[] { changeInteval }),
                                getClass());
                    }
                }
                if (passwordEncoder.matches(password, h.getPassword())) {
                    throw new CapMessageException(CapAppContext.getMessage(
                            "error.003", new Object[] { maxHistory }),
                            getClass());
                }
                i++;
View Full Code Here

    @Override
    public boolean validatePassword(String userId, String password) {
        User user = userDao.findByCode(userId);
        PasswordEncoder passwordEncoder = new StandardPasswordEncoder(userId);
        return passwordEncoder.matches(password, user.getPassword());
    }

    @Override
    public void changeUserPassword(String userId, String password) {
        SysParm parmPwdExpiredDay = commonDao.findById(SysParm.class,
View Full Code Here

        this.log.debug("REST request to set account's password");
        try {
            User currentUser = authenticationService.getCurrentUser();
            StandardPasswordEncoder encoder = new StandardPasswordEncoder();

            if (!encoder.matches(userPassword.getOldPassword(), currentUser.getPassword())) {
                log.debug("The old password is incorrect : {}", userPassword.getOldPassword());
                throw new Exception("oldPassword");
            }

            if (!userPassword.getNewPassword().equals(userPassword.getNewPasswordConfirmation())) {
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.