Package org.springframework.security.providers.encoding

Examples of org.springframework.security.providers.encoding.ShaPasswordEncoder


        if (doEncrypt) {
            DaoAuthenticationProvider provider = (DaoAuthenticationProvider) ctx.getBean("org.springframework.security.providers.dao.DaoAuthenticationProvider#0");
            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.");
            }
View Full Code Here


        UserDetailsAdapter userDetails = new UserDetailsAdapter(user); // 1
        String password = userDetails.getPassword();
        ReflectionSaltSource saltSource = new ReflectionSaltSource();
        saltSource.setUserPropertyToUse("username");
        Object salt = saltSource.getSalt(userDetails); // 2
        user.setPassword((new ShaPasswordEncoder()).encodePassword(password, salt)); // 3
    }
View Full Code Here

TOP

Related Classes of org.springframework.security.providers.encoding.ShaPasswordEncoder

Copyright © 2018 www.massapicom. 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.