Examples of BasicPasswordEncryptor


Examples of org.jasypt.util.password.BasicPasswordEncryptor

     * Checks that the PasswordEncoder has been correctly initialized
     * (either a password encryptor or a string digester has been set).
     */
    private synchronized void checkInitialization() {
        if (this.useEncryptor == null) {
            this.passwordEncryptor = new BasicPasswordEncryptor();
            this.useEncryptor = Boolean.TRUE;
        } else {
            if (this.useEncryptor.booleanValue()) {
                if (this.passwordEncryptor == null) {
                    throw new EncryptionInitializationException(
View Full Code Here

Examples of org.jasypt.util.password.BasicPasswordEncryptor

  @Override
  public Users loginCheck(String id, String pass) {
       
    Users validate = usersRepository.findOne(id);
   
    BasicPasswordEncryptor passwordEncryptor = new BasicPasswordEncryptor();
    if ((validate != null && validate.getEnabled()) && passwordEncryptor.checkPassword(pass, validate.getPassword())){
      return validate;
    } else{
      return null;
    }
  }
View Full Code Here

Examples of org.jasypt.util.password.BasicPasswordEncryptor

  }

  @Override
  public boolean changePassword(String id, String password) {
    Users userUpdate;
    BasicPasswordEncryptor passwordEncryptor = new BasicPasswordEncryptor();
    userUpdate = usersRepository.findOne(id);
    if (userUpdate == null || !userUpdate.getEnabled()){
      return false;
    } else {
      userUpdate.setPassword(passwordEncryptor.encryptPassword(password));
      save(userUpdate.getId(), userUpdate);
    }

    return true;
  }
View Full Code Here

Examples of org.jasypt.util.password.BasicPasswordEncryptor

    ctx.refresh();

    UsersService usersService = ctx.getBean("usersService", UsersService.class);
    PreferencesService preferenceService = ctx.getBean("preferencesService", PreferencesService.class);

    BasicPasswordEncryptor passwordEncryptor = new BasicPasswordEncryptor();
    String encryptedPassword = passwordEncryptor.encryptPassword(request.getParameter("pw"));

    if(usersService.findById(request.getParameter("un")) != null) {
      request.setAttribute("registrationMessage", "Username is already taken please regiser with another user name.");
      String url = "/Register.jsp";
      RequestDispatcher dispatcher = getServletContext().getRequestDispatcher(url);
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.