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

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


            setActions(action);

            String uid = getTestPrincipal().getName();
            u = impl.createUser(uid, buildPassword(uid));

            u.changePassword("pw1");
            assertEquals(1, action.called);

            u.changePassword("pw2", "pw1");
            assertEquals(2, action.called);
        } finally {
View Full Code Here


            u = impl.createUser(uid, buildPassword(uid));

            u.changePassword("pw1");
            assertEquals(1, action.called);

            u.changePassword("pw2", "pw1");
            assertEquals(2, action.called);
        } finally {
            if (u != null) {
                u.remove();
            }
View Full Code Here

            invalid.add("WITHOUTLOWERCASE");
            invalid.add("withoutuppercase");

            for (String pw : invalid) {
                try {
                    u.changePassword(pw);
                    fail("should throw constraint violation");
                } catch (ConstraintViolationException e) {
                    // success
                }
            }
View Full Code Here

            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

            testUser = session.getUserManager().createUser(testUserId, "password");
        }

        session.save();

        testUser.changePassword("newPassword");
        session.save();

        assertEquals("newPassword", newPassword);
    }
View Full Code Here

        createUser(userId);

        UserManager testUserMgr = getUserManager(testSession);
        User user = (User) testUserMgr.getAuthorizable(userId);
        try {
            user.changePassword("pw2");
            testSession.save();
            fail();
        } catch (AccessDeniedException e) {
            // success
        }
View Full Code Here

        modify("/", PrivilegeConstants.REP_WRITE, true);

        UserManager testUserMgr = getUserManager(testSession);
        User user = (User) testUserMgr.getAuthorizable(userId);
        try {
            user.changePassword("pw2");
            testSession.save();
            fail();
        } catch (AccessDeniedException e) {
            // success
        }
View Full Code Here

        // after granting user-mgt privilege changing the pw must succeed.
        modify("/", PrivilegeConstants.REP_USER_MANAGEMENT, true);

        UserManager testUserMgr = getUserManager(testSession);
        User user = (User) testUserMgr.getAuthorizable(userId);
        user.changePassword("pw2");
        testSession.save();
    }

    @Test
    public void testDisableUserWithoutPermission() throws Exception {
View Full Code Here

        String uid = "existing";
        User user = userMgr.createUser(uid, uid);

        // change password to force existence of password last modified property
        user.changePassword(uid);
        adminSession.save();

        Node userNode = adminSession.getNode(user.getPath());
        assertTrue(userNode.hasNode(UserConstants.REP_PWD));
        Node pwdNode = userNode.getNode(UserConstants.REP_PWD);
View Full Code Here

    @Test
    public void testChangePassword() throws Exception {
        User user = getTestUser();
        PropertyState p1 = root.getTree(user.getPath()).getChild(UserConstants.REP_PWD).getProperty(UserConstants.REP_PASSWORD_LAST_MODIFIED);
        assertNull(p1);
        user.changePassword(userId);
        root.commit();
        PropertyState p2 = root.getTree(user.getPath()).getChild(UserConstants.REP_PWD).getProperty(UserConstants.REP_PASSWORD_LAST_MODIFIED);
        assertNotNull(p2);
        assertTrue(p2.getValue(Type.LONG) > 0);
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.