Package org.apache.jackrabbit.oak.spi.security.authentication.external

Examples of org.apache.jackrabbit.oak.spi.security.authentication.external.ExternalGroup


        private void syncAuthorizable(ExternalIdentity externalUser, Authorizable authorizable)
                throws RepositoryException, SyncException, ExternalIdentityException {
            for (ExternalIdentityRef externalGroupRef : externalUser.getDeclaredGroups()) {
                ExternalIdentity id = idp.getIdentity(externalGroupRef);
                if (id instanceof ExternalGroup) {
                    ExternalGroup externalGroup = (ExternalGroup) id;
                    String groupId = externalGroup.getId();
                    Group group;
                    Authorizable a = userManager.getAuthorizable(groupId);
                    if (a == null) {
                        group = createGroup(externalGroup);
                    } else {
View Full Code Here


        assertEquals("Group Name", TEST_GROUP1_NAME, id.getId());
    }

    @Test
    public void testGetGroupByName() throws Exception {
        ExternalGroup group = idp.getGroup(TEST_GROUP1_NAME);
        assertNotNull("Group 1 must exist", group);
        assertEquals("Group Ref", TEST_GROUP1_DN, group.getExternalId().getId());
    }
View Full Code Here

    public void testGetMembers() throws Exception {
        ExternalIdentityRef ref = new ExternalIdentityRef(TEST_GROUP1_DN, IDP_NAME);
        ExternalIdentity id = idp.getIdentity(ref);
        assertTrue("Group instance", id instanceof ExternalGroup);

        ExternalGroup grp = (ExternalGroup) id;
        assertIfEquals("Group members", TEST_GROUP1_MEMBERS, grp.getDeclaredMembers());
    }
View Full Code Here

        assertEquals("Group Name", TEST_GROUP1_NAME, id.getId());
    }

    @Test
    public void testGetGroupByName() throws Exception {
        ExternalGroup group = idp.getGroup(TEST_GROUP1_NAME);
        assertNotNull("Group 1 must exist", group);
        assertEquals("Group Ref", TEST_GROUP1_DN, group.getExternalId().getId());
    }
View Full Code Here

    public void testGetMembers() throws Exception {
        ExternalIdentityRef ref = new ExternalIdentityRef(TEST_GROUP1_DN, IDP_NAME);
        ExternalIdentity id = idp.getIdentity(ref);
        assertTrue("Group instance", id instanceof ExternalGroup);

        ExternalGroup grp = (ExternalGroup) id;
        assertIfEquals("Group members", TEST_GROUP1_MEMBERS, grp.getDeclaredMembers());
    }
View Full Code Here

                    return false;
                }

                if (auth instanceof Group) {
                    Group group = (Group) auth;
                    ExternalGroup external = idp.getGroup(id);
                    timer.mark("retrieve");
                    if (external == null) {
                        if (group.getDeclaredMembers().hasNext()) {
                            log.info("won't remove local group with members: {}", id);
                        } else {
View Full Code Here

            timer.mark("reading");

            for (ExternalIdentityRef ref: externalGroups) {
                log.debug("- processing membership {}", ref.getId());
                // get group
                ExternalGroup extGroup;
                try {
                    extGroup = (ExternalGroup) idp.getIdentity(ref);
                } catch (ClassCastException e) {
                    // this should really not be the case, so catching the CCE is ok here.
                    log.warn("External identity '{}' is not a group, but should be one.", ref.getString());
                    continue;
                } catch (ExternalIdentityException e) {
                    log.warn("Unable to retrieve external group '{}' from provider.", ref.getString(), e);
                    continue;
                }
                if (extGroup == null) {
                    log.warn("External group for ref '{}' could not be retrieved from provider.", ref);
                    continue;
                }
                log.debug("- idp returned '{}'", extGroup.getId());

                Group grp;
                try {
                    grp = (Group) userManager.getAuthorizable(extGroup.getId());
                } catch (ClassCastException e) {
                    // this should really not be the case, so catching the CCE is ok here.
                    log.warn("Authorizable '{}' is not a group, but should be one.", extGroup.getId());
                    continue;
                }
                log.debug("- user manager returned '{}'", grp);

                if (grp == null) {
View Full Code Here

                    return new SyncResultImpl(new SyncedIdentityImpl(id, null, false, -1), SyncResult.Status.FOREIGN);
                }

                if (auth instanceof Group) {
                    Group group = (Group) auth;
                    ExternalGroup external = idp.getGroup(id);
                    timer.mark("retrieve");
                    if (external == null) {
                        SyncedIdentityImpl syncId = createSyncedIdentity(auth);
                        if (group.getDeclaredMembers().hasNext()) {
                            log.info("won't remove local group with members: {}", id);
View Full Code Here

            timer.mark("reading");

            for (ExternalIdentityRef ref: externalGroups) {
                log.debug("- processing membership {}", ref.getId());
                // get group
                ExternalGroup extGroup;
                try {
                    extGroup = (ExternalGroup) idp.getIdentity(ref);
                } catch (ClassCastException e) {
                    // this should really not be the case, so catching the CCE is ok here.
                    log.warn("External identity '{}' is not a group, but should be one.", ref.getString());
                    continue;
                } catch (ExternalIdentityException e) {
                    log.warn("Unable to retrieve external group '{}' from provider.", ref.getString(), e);
                    continue;
                }
                if (extGroup == null) {
                    log.warn("External group for ref '{}' could not be retrieved from provider.", ref);
                    continue;
                }
                log.debug("- idp returned '{}'", extGroup.getId());

                Group grp;
                try {
                    grp = (Group) userManager.getAuthorizable(extGroup.getId());
                } catch (ClassCastException e) {
                    // this should really not be the case, so catching the CCE is ok here.
                    log.warn("Authorizable '{}' is not a group, but should be one.", extGroup.getId());
                    continue;
                }
                log.debug("- user manager returned '{}'", grp);

                if (grp == null) {
View Full Code Here

        assertEquals("Group Name", TEST_GROUP1_NAME, id.getId());
    }

    @Test
    public void testGetGroupByName() throws Exception {
        ExternalGroup group = idp.getGroup(TEST_GROUP1_NAME);
        assertNotNull("Group 1 must exist", group);
        assertEquals("Group Ref", TEST_GROUP1_DN, group.getExternalId().getId());
    }
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.oak.spi.security.authentication.external.ExternalGroup

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.