Package org.springframework.security.providers.dao.salt

Examples of org.springframework.security.providers.dao.salt.ReflectionSaltSource


    // SaltSource
    bind(SaltSource.class).toProvider(new Provider<SaltSource>() {

      public SaltSource get() {
        final ReflectionSaltSource rss = new ReflectionSaltSource();
        rss.setUserPropertyToUse("getUsername");
        return rss;
      }

    }).in(Scopes.SINGLETON);
View Full Code Here


    public static void encodPassword(User user) {
        LOGGER.debug("Encodage du password");
        // Encodage du passord et salt;
        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.dao.salt.ReflectionSaltSource

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.