Search in sources :

Example 1 with DynamicSyncContext

use of org.apache.jackrabbit.oak.spi.security.authentication.external.impl.DynamicSyncContext in project jackrabbit-oak by apache.

the class AbstractPrincipalTest method before.

@Override
public void before() throws Exception {
    super.before();
    // sync external users into the system using the 2 different sync-context implementations
    Root systemRoot = getSystemRoot();
    SyncContext syncContext = new DynamicSyncContext(syncConfig, idp, getUserManager(systemRoot), getValueFactory(systemRoot));
    syncContext.sync(idp.getUser(USER_ID));
    syncContext.close();
    syncContext = new DefaultSyncContext(syncConfig, idp, getUserManager(systemRoot), getValueFactory(systemRoot));
    syncContext.sync(idp.getUser(TestIdentityProvider.ID_SECOND_USER));
    syncContext.close();
    systemRoot.commit();
    root.refresh();
    principalProvider = createPrincipalProvider();
}
Also used : DefaultSyncContext(org.apache.jackrabbit.oak.spi.security.authentication.external.basic.DefaultSyncContext) Root(org.apache.jackrabbit.oak.api.Root) DynamicSyncContext(org.apache.jackrabbit.oak.spi.security.authentication.external.impl.DynamicSyncContext) SyncContext(org.apache.jackrabbit.oak.spi.security.authentication.external.SyncContext) DefaultSyncContext(org.apache.jackrabbit.oak.spi.security.authentication.external.basic.DefaultSyncContext) DynamicSyncContext(org.apache.jackrabbit.oak.spi.security.authentication.external.impl.DynamicSyncContext)

Example 2 with DynamicSyncContext

use of org.apache.jackrabbit.oak.spi.security.authentication.external.impl.DynamicSyncContext in project jackrabbit-oak by apache.

the class ExternalGroupPrincipalProviderTest method sync.

void sync(@Nonnull ExternalUser externalUser) throws Exception {
    Root systemRoot = getSystemRoot();
    DynamicSyncContext syncContext = new DynamicSyncContext(syncConfig, idp, getUserManager(systemRoot), getValueFactory(systemRoot));
    syncContext.sync(externalUser);
    syncContext.close();
    systemRoot.commit();
    root.refresh();
}
Also used : Root(org.apache.jackrabbit.oak.api.Root) DynamicSyncContext(org.apache.jackrabbit.oak.spi.security.authentication.external.impl.DynamicSyncContext)

Aggregations

Root (org.apache.jackrabbit.oak.api.Root)2 DynamicSyncContext (org.apache.jackrabbit.oak.spi.security.authentication.external.impl.DynamicSyncContext)2 SyncContext (org.apache.jackrabbit.oak.spi.security.authentication.external.SyncContext)1 DefaultSyncContext (org.apache.jackrabbit.oak.spi.security.authentication.external.basic.DefaultSyncContext)1