Package org.apache.jackrabbit.api.security.user

Examples of org.apache.jackrabbit.api.security.user.User.changePassword()


            valid.add("cDDDDDDDDDDDDDDDDD");
            valid.add("gH%%%%%%%%%%%%%%%%^^");
            valid.add("&)(*&^%23qW");

            for (String pw : valid) {
                u.changePassword(pw);
            }

        } finally {
            if (u != null) {
                u.remove();
View Full Code Here


            PasswordValidationAction pwAction = new PasswordValidationAction();
            pwAction.setConstraint("abc");
            setActions(pwAction);

            String hashed = PasswordUtility.buildPasswordHash("abc");
            u.changePassword(hashed);

            fail("Password change must always enforce password validation.");

        } catch (ConstraintViolationException e) {
            // success
View Full Code Here

        pwds.put(md5Hash, md5Hash);
        pwds.put("{"+SecurityConstants.DEFAULT_DIGEST+"}any", "{"+SecurityConstants.DEFAULT_DIGEST+"}any");
        pwds.put("{"+SecurityConstants.DEFAULT_DIGEST+"}", "{"+SecurityConstants.DEFAULT_DIGEST+"}");

        for (String pw : pwds.keySet()) {
            u.changePassword(pw);

            String plain = pwds.get(pw);
            SimpleCredentials sc = new SimpleCredentials(u.getID(), plain.toCharArray());
            CryptedSimpleCredentials cc = (CryptedSimpleCredentials) u.getCredentials();
View Full Code Here

        noMatch.put("{"+SecurityConstants.DEFAULT_DIGEST+"}any", "any");
        noMatch.put(sha1Hash, "abc");
        noMatch.put(md5Hash, "abc");

        for (String pw : noMatch.keySet()) {
            u.changePassword(pw);

            String plain = noMatch.get(pw);
            SimpleCredentials sc = new SimpleCredentials(u.getID(), plain.toCharArray());
            CryptedSimpleCredentials cc = (CryptedSimpleCredentials) u.getCredentials();
View Full Code Here

    public void testChangePasswordNull() throws RepositoryException {
        User u = (User) userMgr.getAuthorizable(uID);

        // invalid 'null' pw string
        try {
            u.changePassword(null);
            fail("invalid pw null");
        } catch (Exception e) {
            // success
        }
    }
View Full Code Here

            throw new NotExecutableException();
        }

        User user = getTestUser(superuser);
        try {
            user.changePassword("pw");
            save(superuser);

            SimpleCredentials creds = new SimpleCredentials(user.getID(), "pw".toCharArray());
            assertTrue(((CryptedSimpleCredentials) user.getCredentials()).matches(creds));
        } finally {
View Full Code Here

            save(superuser);

            SimpleCredentials creds = new SimpleCredentials(user.getID(), "pw".toCharArray());
            assertTrue(((CryptedSimpleCredentials) user.getCredentials()).matches(creds));
        } finally {
            user.changePassword(oldPw);
            save(superuser);
        }
    }
}
View Full Code Here

        // passwords already in hashed format.
        pwds.put(sha1Hash, "abc");
        pwds.put(md5Hash, "abc");

        for (String pw : pwds.keySet()) {
            u.changePassword(pw);

            String plain = pwds.get(pw);
            SimpleCredentials sc = new SimpleCredentials(u.getID(), plain.toCharArray());
            CryptedSimpleCredentials cc = (CryptedSimpleCredentials) u.getCredentials();
View Full Code Here

        noMatch.put("{"+SecurityConstants.DEFAULT_DIGEST+"}any", "{"+SecurityConstants.DEFAULT_DIGEST+"}any");
        noMatch.put(sha1Hash, sha1Hash);
        noMatch.put(md5Hash, md5Hash);

        for (String pw : noMatch.keySet()) {
            u.changePassword(pw);

            String plain = noMatch.get(pw);
            SimpleCredentials sc = new SimpleCredentials(u.getID(), plain.toCharArray());
            CryptedSimpleCredentials cc = (CryptedSimpleCredentials) u.getCredentials();
View Full Code Here

            assertFalse(cc.matches(sc));
        }

        // invalid pw string
        try {
            u.changePassword(null);
            fail("invalid pw null");
        } catch (Exception e) {
            // success
        }
    }
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.