Examples of LdapShaPasswordEncoder


Examples of org.acegisecurity.providers.ldap.LdapShaPasswordEncoder

     * @throws SystemUnavailableException If the SHA1 algorithm is not
     * supported by the JVM.
     */
    public void setSecret(String person_id, String question_in, String secret_in)
            throws SystemUnavailableException, UniFileException, UniSessionException {
        LdapShaPasswordEncoder pwd = new LdapShaPasswordEncoder();
        String secret_hash = pwd.encodePassword(secret_in.toUpperCase(), null);
        local_params.setId(person_id);
        local_params.question.set(question_in);
        local_params.answer.set(secret_hash);
    }
View Full Code Here

Examples of org.acegisecurity.providers.ldap.LdapShaPasswordEncoder

        if (secret.equals("")) {
            found_match = true;
        } else {
            // otherwise compare the hashes
            secret_in = Validate.sanitize(secret_in, SECRET_LEN);
            LdapShaPasswordEncoder pwd = new LdapShaPasswordEncoder();
            found_match = pwd.isPasswordValid(secret, secret_in.toUpperCase(), null);
        }
        return found_match;
    }
View Full Code Here

Examples of org.acegisecurity.providers.ldap.LdapShaPasswordEncoder

     * @return true if the checkPassword matches one in the history
     */
    public boolean checkPasswordHistory(String person_id, String passwd) {
        boolean result = false;
        try {
            LdapShaPasswordEncoder enc = new LdapShaPasswordEncoder();
            local_params.setId(person_id);
            String hist = local_params.getPassword();
            if (!hist.equals("")) {
                result = enc.isPasswordValid(hist, passwd, null);
            }


        } catch (UniFileException ex) {
            String vars[] = {person_id, ex.toString()};
View Full Code Here

Examples of org.acegisecurity.providers.ldap.LdapShaPasswordEncoder

            byte[] salt = null;

            // set password is a ldap modify operation
            ModificationItem[] mods = new ModificationItem[2];

            LdapShaPasswordEncoder pwd = new LdapShaPasswordEncoder();
            String passwd_hash = pwd.encodePassword(new_passwd, salt);

            Attribute passwd = new BasicAttribute("userPassword", passwd_hash);
            mods[0] = new ModificationItem(DirContext.REPLACE_ATTRIBUTE, passwd);

            Attribute slchanged = new BasicAttribute("shadowLastChange", ts);
View Full Code Here

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

    //~ Methods ========================================================================================================

    @Before
    public void setUp() throws Exception {
        sha = new LdapShaPasswordEncoder();
    }
View Full Code Here

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

    @Test
    public void testLdapCompareSucceedsWithShaEncodedPassword() {
        // Don't retrieve the password
        authenticator.setUserAttributes(new String[] {"uid"});
        authenticator.setPasswordEncoder(new LdapShaPasswordEncoder());
        authenticator.authenticate(ben);
    }
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.