Examples of PartitionManager


Examples of org.picketlink.idm.PartitionManager

    }

    @Override
    public LDAPFederationProvider getInstance(KeycloakSession session, UserFederationProviderModel model) {
        PartitionManagerProvider idmProvider = session.getProvider(PartitionManagerProvider.class);
        PartitionManager partition = idmProvider.getPartitionManager(model);
        return new LDAPFederationProvider(session, model, partition);
    }
View Full Code Here

Examples of org.picketlink.idm.PartitionManager

    @Override
    public void syncAllUsers(KeycloakSessionFactory sessionFactory, String realmId, UserFederationProviderModel model) {
        logger.infof("Sync all users from LDAP to local store: realm: %s, federation provider: %s, current time: " + new Date(), realmId, model.getDisplayName());

        PartitionManagerProvider idmProvider = sessionFactory.create().getProvider(PartitionManagerProvider.class);
        PartitionManager partitionMgr = idmProvider.getPartitionManager(model);
        IdentityQuery<User> userQuery = partitionMgr.createIdentityManager().createIdentityQuery(User.class);
        syncImpl(sessionFactory, userQuery, realmId, model);

        // TODO: Remove all existing keycloak users, which have federation links, but are not in LDAP. Perhaps don't check users, which were just added or updated during this sync?
    }
View Full Code Here

Examples of org.picketlink.idm.PartitionManager

    @Override
    public void raiseEvent(Object event) {
        // Used in ActiveDirectory to put account into "enabled" state (aka userAccountControl=512, see http://support.microsoft.com/kb/305144/en ) after password update. If value is -1, it's ignored
        if (updateUserAccountAfterPasswordUpdate && event instanceof CredentialUpdatedEvent) {
            CredentialUpdatedEvent credEvent = ((CredentialUpdatedEvent) event);
            PartitionManager partitionManager = credEvent.getPartitionMananger();
            IdentityContext identityCtx = (IdentityContext)partitionManager.createIdentityManager();

            CredentialStore store = ((StoreSelector)partitionManager).getStoreForCredentialOperation(identityCtx, credEvent.getCredential().getClass());
            if (store instanceof LDAPIdentityStore) {
                LDAPIdentityStore ldapStore = (LDAPIdentityStore)store;
                LDAPOperationManager operationManager = ldapStore.getOperationManager();
View Full Code Here

Examples of org.picketlink.idm.PartitionManager

    @Override
    public void syncChangedUsers(KeycloakSessionFactory sessionFactory, String realmId, UserFederationProviderModel model, Date lastSync) {
        logger.infof("Sync changed users from LDAP to local store: realm: %s, federation provider: %s, current time: " + new Date() + ", last sync time: " + lastSync, realmId, model.getDisplayName());

        PartitionManagerProvider idmProvider = sessionFactory.create().getProvider(PartitionManagerProvider.class);
        PartitionManager partitionMgr = idmProvider.getPartitionManager(model);

        // Sync newly created users
        IdentityManager identityManager = partitionMgr.createIdentityManager();
        IdentityQuery<User> userQuery = identityManager.createIdentityQuery(User.class)
                .setParameter(IdentityType.CREATED_AFTER, lastSync);
        syncImpl(sessionFactory, userQuery, realmId, model);

        // Sync updated users
View Full Code Here

Examples of org.picketlink.idm.PartitionManager

        // Ldap config might have changed for the realm. In this case, we must re-initialize
        Map<String, String> config = model.getConfig();
        if (context == null || !config.equals(context.config)) {
            logLDAPConfig(model.getId(), config);

            PartitionManager manager = createPartitionManager(config);
            context = new PartitionManagerContext(config, manager);
            partitionManagers.put(model.getId(), context);
        }
        return context.partitionManager;
    }
View Full Code Here

Examples of org.picketlink.idm.PartitionManager

    }

    @Test
    public void testSearch() {
        KeycloakSession session = keycloakRule.startSession();
        PartitionManager partitionManager = getPartitionManager(session, ldapModel);
        try {
            RealmModel appRealm = session.realms().getRealmByName("test");
            LDAPUtils.addUser(partitionManager, "username1", "John1", "Doel1", "user1@email.org");
            LDAPUtils.addUser(partitionManager, "username2", "John2", "Doel2", "user2@email.org");
            LDAPUtils.addUser(partitionManager, "username3", "John3", "Doel3", "user3@email.org");
View Full Code Here

Examples of org.picketlink.idm.PartitionManager

            // wait a bit
            sleep(1000);

            // Add user to LDAP and update 'user5' in LDAP
            PartitionManager partitionManager = FederationProvidersIntegrationTest.getPartitionManager(session, ldapModel);
            LDAPUtils.addUser(partitionManager, "user6", "User6FN", "User6LN", "user6@email.org");
            LDAPUtils.updateUser(partitionManager, "user5", "User5FNUpdated", "User5LNUpdated", "user5Updated@email.org");

            // Assert still old users in local provider
            assertUserImported(userProvider, testRealm, "user5", "User5FN", "User5LN", "user5@email.org");
View Full Code Here

Examples of org.wso2.carbon.apacheds.PartitionManager

                /* replace default password with that is provided in the configuration file.*/
                this.ldapServer.changeConnectionUserPassword(
                        configurationBuilder.getConnectionPassword());

                // Add admin (default)partition if it is not already created.
                PartitionManager partitionManager = this.ldapServer.getPartitionManager();
                PartitionInfo defaultPartitionInfo=
                        configurationBuilder.getPartitionConfigurations();
                boolean defaultPartitionAlreadyExisted=partitionManager.partitionDirectoryExists(
                        defaultPartitionInfo.getPartitionId());

                if (!defaultPartitionAlreadyExisted) {
                    partitionManager.addPartition(defaultPartitionInfo);
                } else {
                    partitionManager.initializeExistingPartition(defaultPartitionInfo);
                }

                // Start KDC if enabled
                if (configurationBuilder.isKdcEnabled()) {

View Full Code Here

Examples of org.wso2.carbon.apacheds.PartitionManager

                    }
                }
            }

            try {
                PartitionManager partitionManager = this.ldapServer.getPartitionManager();
                partitionManager.removeAllPartitions();
                this.ldapServer.stop();
            } catch (DirectoryServerException e) {
                e.printStackTrace();
            }
View Full Code Here

Examples of org.wso2.carbon.apacheds.PartitionManager

    }

    public void testAdd2Partitions()
        throws DirectoryServerException {

        PartitionManager partitionManager = this.embeddedLdap.getPartitionManager();

        AdminGroupInfo groupInfo = new AdminGroupInfo("cn", "member", "admin");
        AdminInfo adminInfo =
            new AdminInfo("duck", "Donald", "Duck", "dduck@wso2.com", "password", PasswordAlgorithm.MD5, groupInfo);
        PartitionInfo partitionInfo = new PartitionInfo("duck1", "wso2donald.com", "dc=wso2donald,dc=com", adminInfo);

        assertFalse("Partition already exists", partitionManager.partitionInitialized(partitionInfo.getPartitionId()));
        partitionManager.addPartition(partitionInfo);
        assertTrue("Partition has not created", partitionManager.partitionInitialized(partitionInfo.getPartitionId()));

        addDummyPartition();

    }
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.