Examples of Md5PasswordEncoder


Examples of org.acegisecurity.providers.encoding.Md5PasswordEncoder

            String algorithm = WebloggerConfig.getProperty("passwds.encryption.algorithm");
            PasswordEncoder encoder = null;
            if (algorithm.equalsIgnoreCase("SHA")) {
                encoder = new ShaPasswordEncoder();
            } else if (algorithm.equalsIgnoreCase("MD5")) {
                encoder = new Md5PasswordEncoder();
            } else {
                log.error("Encryption algorithm '" + algorithm +
                        "' not supported, disabling encryption.");
            }
            if (encoder != null) {
View Full Code Here

Examples of org.acegisecurity.providers.encoding.Md5PasswordEncoder

            String algorithm = RollerConfig.getProperty("passwds.encryption.algorithm");
            PasswordEncoder encoder = null;
            if (algorithm.equalsIgnoreCase("SHA")) {
                encoder = new ShaPasswordEncoder();
            } else if (algorithm.equalsIgnoreCase("MD5")) {
                encoder = new Md5PasswordEncoder();
            } else {
                mLogger.error("Encryption algorithm '" + algorithm +
                        "' not supported, disabling encryption.");
            }
            if (encoder != null) {
View Full Code Here

Examples of org.acegisecurity.providers.encoding.Md5PasswordEncoder

            String algorithm = RollerConfig.getProperty("passwds.encryption.algorithm");
            PasswordEncoder encoder = null;
            if (algorithm.equalsIgnoreCase("SHA")) {
                encoder = new ShaPasswordEncoder();
            } else if (algorithm.equalsIgnoreCase("MD5")) {
                encoder = new Md5PasswordEncoder();
            } else {
                mLogger.error("Encryption algorithm '" + algorithm +
                        "' not supported, disabling encryption.");
            }
            if (encoder != null) {
View Full Code Here

Examples of org.acegisecurity.providers.encoding.Md5PasswordEncoder

            String algorithm = RollerConfig.getProperty("passwds.encryption.algorithm");
            PasswordEncoder encoder = null;
            if (algorithm.equalsIgnoreCase("SHA")) {
                encoder = new ShaPasswordEncoder();
            } else if (algorithm.equalsIgnoreCase("MD5")) {
                encoder = new Md5PasswordEncoder();
            } else {
                mLogger.error("Encryption algorithm '" + algorithm +
                        "' not supported, disabling encryption.");
            }
            if (encoder != null) {
View Full Code Here

Examples of org.springframework.security.authentication.encoding.Md5PasswordEncoder

        }
    }

    private String getHash() throws NoSuchAlgorithmException, UnsupportedEncodingException
    {
        PasswordEncoder encoder = new Md5PasswordEncoder();
        String hashedPass = encoder.encodePassword(password, null);

        password = password.replaceAll(".*", "0");
        passwordConf = passwordConf.replaceAll(".*", "0");
        return hashedPass;
    }
View Full Code Here

Examples of org.springframework.security.authentication.encoding.Md5PasswordEncoder

    }
  }
 
  private UserDetails makeRootUser(InternalUser user) {
    Object salt = null;
    Md5PasswordEncoder encoder = new Md5PasswordEncoder();
    return new User(user.getEmail(), encoder.encodePassword(user.getPassword(), salt),
        true, true, true, true, makeRootGrantedAuthorities());
  }
View Full Code Here

Examples of org.springframework.security.authentication.encoding.Md5PasswordEncoder

    return authorities;
  }
 
  private UserDetails makeUser(InternalUser user) throws Exception {
    Object salt = null;
    Md5PasswordEncoder encoder = new Md5PasswordEncoder();
   
    if(user.getAdmin() != null && user.getAdmin()) {
      return new User(user.getEmail(), encoder.encodePassword(user.getPassword(), salt),
          true, true, true, true, makeAdminGrantedAuthorities());
    }
   
    // TODO change it! By default it's a provider user
    return new User(user.getEmail(), encoder.encodePassword(user.getPassword(), salt),
        true, true, true, true, makeProviderGrantedAuthorities(user));
  }
View Full Code Here

Examples of org.springframework.security.authentication.encoding.Md5PasswordEncoder

  public static void main(String[] args) {
    if (args.length != 3) {
      System.out.println("Usage : [md5|sha|plaintext] username password");
    } else if (args[0].equals("md5")) {
      PasswordEncoder encoder = new Md5PasswordEncoder();
      System.out.println(encoder.encodePassword(args[2], args[1]));
    } else if (args[0].equals("sha")) {
      PasswordEncoder encoder = new ShaPasswordEncoder();
      System.out.println(encoder.encodePassword(args[2], args[1]));
    } else if (args[0].equals("plaintext")) {
      PasswordEncoder encoder = new PlaintextPasswordEncoder();
      System.out.println(encoder.encodePassword(args[2], args[1]));
    } else {
      System.out.println("Algorithm must be md5, sha or plaintext");
    }
  }
View Full Code Here

Examples of org.springframework.security.authentication.encoding.Md5PasswordEncoder

  @RequestMapping(value = { "/generatePassword" }, method = RequestMethod.GET)
  public ResponseEntity<String> generatePassword(ModelMap modelMap, HttpServletRequest request, HttpServletResponse response) throws Exception {
    HttpHeaders responseHeaders = new HttpHeaders();
    responseHeaders.add("Content-Type", MediaType.TEXT_PLAIN.toString());
    return new ResponseEntity<String>(new Md5PasswordEncoder().encodePassword(request.getParameter("passwordField"), null), responseHeaders, HttpStatus.CREATED);
  }
View Full Code Here

Examples of org.springframework.security.authentication.encoding.Md5PasswordEncoder

    @Test
    public void userShouldBeRegisteredUsingEncryptedPassword() throws Exception{
        String password = "password";
        RegisterUserDto registerUserDto = createRegisterUserDto("username", password, "email@email.em", null);
        EncryptionService realEncryptionService = new EncryptionService(new Md5PasswordEncoder());
        TransactionalAuthenticator authenticatorSpy = spy(new TransactionalAuthenticator(pluginLoader, userDao, groupDao,
                realEncryptionService, mailService, avatarService, pluginService,
                securityFacade, rememberMeServices, sessionStrategy, validator, authenticationManager));

        authenticatorSpy.register(registerUserDto);
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.