use of org.apache.jackrabbit.oak.spi.security.authentication.external.basic.DefaultSyncConfig in project jackrabbit-oak by apache.
the class PrincipalProviderAutoMembershipTest method createSyncConfig.
@Override
protected DefaultSyncConfig createSyncConfig() {
DefaultSyncConfig syncConfig = super.createSyncConfig();
syncConfig.user().setAutoMembership(AUTO_MEMBERSHIP_GROUP_ID, NON_EXISTING_GROUP_ID);
return syncConfig;
}
use of org.apache.jackrabbit.oak.spi.security.authentication.external.basic.DefaultSyncConfig in project jackrabbit-oak by apache.
the class ExternalIdentityValidatorTest method createSyncConfig.
@Override
protected DefaultSyncConfig createSyncConfig() {
DefaultSyncConfig config = super.createSyncConfig();
config.user().setDynamicMembership(isDynamic());
return config;
}
use of org.apache.jackrabbit.oak.spi.security.authentication.external.basic.DefaultSyncConfig in project jackrabbit-oak by apache.
the class DefaultSyncConfigImpl method of.
/**
* Creates a new LDAP provider configuration based on the properties store in the given parameters.
* @param params the configuration parameters.
* @return the config
*/
public static DefaultSyncConfig of(ConfigurationParameters params) {
DefaultSyncConfig cfg = new DefaultSyncConfigImpl().setName(params.getConfigValue(PARAM_NAME, PARAM_NAME_DEFAULT));
cfg.user().setDisableMissing(params.getConfigValue(PARAM_DISABLE_MISSING_USERS, PARAM_DISABLE_MISSING_USERS_DEFAULT)).setMembershipExpirationTime(getMilliSeconds(params, PARAM_USER_MEMBERSHIP_EXPIRATION_TIME, PARAM_USER_MEMBERSHIP_EXPIRATION_TIME_DEFAULT, ONE_HOUR)).setMembershipNestingDepth(params.getConfigValue(PARAM_USER_MEMBERSHIP_NESTING_DEPTH, PARAM_USER_MEMBERSHIP_NESTING_DEPTH_DEFAULT)).setDynamicMembership(params.getConfigValue(PARAM_USER_DYNAMIC_MEMBERSHIP, PARAM_USER_DYNAMIC_MEMBERSHIP_DEFAULT)).setExpirationTime(getMilliSeconds(params, PARAM_USER_EXPIRATION_TIME, PARAM_USER_EXPIRATION_TIME_DEFAULT, ONE_HOUR)).setApplyRFC7613UsernameCaseMapped(params.getConfigValue(PARAM_ENABLE_RFC7613_USERCASE_MAPPED_PROFILE, PARAM_ENABLE_RFC7613_USERCASE_MAPPED_PROFILE_DEFAULT)).setPathPrefix(params.getConfigValue(PARAM_USER_PATH_PREFIX, PARAM_USER_PATH_PREFIX_DEFAULT)).setAutoMembership(params.getConfigValue(PARAM_USER_AUTO_MEMBERSHIP, PARAM_USER_AUTO_MEMBERSHIP_DEFAULT)).setPropertyMapping(createMapping(params.getConfigValue(PARAM_USER_PROPERTY_MAPPING, PARAM_USER_PROPERTY_MAPPING_DEFAULT)));
cfg.group().setExpirationTime(getMilliSeconds(params, PARAM_GROUP_EXPIRATION_TIME, PARAM_GROUP_EXPIRATION_TIME_DEFAULT, ONE_DAY)).setApplyRFC7613UsernameCaseMapped(params.getConfigValue(PARAM_ENABLE_RFC7613_USERCASE_MAPPED_PROFILE, PARAM_ENABLE_RFC7613_USERCASE_MAPPED_PROFILE_DEFAULT)).setPathPrefix(params.getConfigValue(PARAM_GROUP_PATH_PREFIX, PARAM_GROUP_PATH_PREFIX_DEFAULT)).setAutoMembership(params.getConfigValue(PARAM_GROUP_AUTO_MEMBERSHIP, PARAM_GROUP_AUTO_MEMBERSHIP_DEFAULT)).setPropertyMapping(createMapping(params.getConfigValue(PARAM_GROUP_PROPERTY_MAPPING, PARAM_GROUP_PROPERTY_MAPPING_DEFAULT)));
return cfg;
}
use of org.apache.jackrabbit.oak.spi.security.authentication.external.basic.DefaultSyncConfig in project jackrabbit-oak by apache.
the class AbstractExternalAuthTest method createSyncConfig.
protected DefaultSyncConfig createSyncConfig() {
DefaultSyncConfig syncConfig = new DefaultSyncConfig();
Map<String, String> mapping = new HashMap<String, String>();
mapping.put("name", "name");
mapping.put("email", "email");
mapping.put("profile/name", "profile/name");
mapping.put("profile/age", "profile/age");
mapping.put(TEST_CONSTANT_PROPERTY_NAME, "\"" + TEST_CONSTANT_PROPERTY_VALUE + "\"");
syncConfig.user().setPropertyMapping(mapping);
syncConfig.user().setMembershipNestingDepth(1);
return syncConfig;
}
use of org.apache.jackrabbit.oak.spi.security.authentication.external.basic.DefaultSyncConfig in project jackrabbit-oak by apache.
the class ExternalLoginModuleAutoMembershipTest method before.
@Override
public void before() throws Exception {
super.before();
r = getSystemRoot();
userManager = getUserManager(r);
valueFactory = getValueFactory(r);
syncConfig.user().setDynamicMembership(true);
// register the ExternalPrincipal configuration in order to have it's
// activate method invoked.
context.registerInjectActivateService(externalPrincipalConfiguration);
// first configuration based on test base-setup with
// - dynamic membership = true
// - auto-membership = 'gr_default' and 'nonExisting'
syncConfig.user().setDynamicMembership(true);
setup1 = new ExternalSetup(idp, syncConfig, WhiteboardUtils.getService(whiteboard, SyncHandler.class), "gr" + UUID.randomUUID());
// second configuration with different IDP ('idp2') and
// - dynamic membership = true
// - auto-membership = 'gr_name2' and 'nonExisting'
DefaultSyncConfig sc2 = new DefaultSyncConfig();
sc2.setName("name2").user().setDynamicMembership(true);
setup2 = new ExternalSetup(new TestIdentityProvider("idp2"), sc2);
// third configuration with different IDP ('idp3') and
// - dynamic membership = false
// - auto-membership = 'gr_name3' and 'nonExisting'
DefaultSyncConfig sc3 = new DefaultSyncConfig();
sc3.setName("name3");
setup3 = new ExternalSetup(new TestIdentityProvider("idp3"), sc3);
// forth configuration based on different IDP ('idp4') but re-using
// sync-handler configuration (sc2)
setup4 = new ExternalSetup(new TestIdentityProvider("idp4"), sc2);
// fifth configuration with different IDP ('idp5') and
// - dynamic membership = true
// - auto-membership => nothing configured
DefaultSyncConfig sc5 = new DefaultSyncConfig();
sc5.setName("name5").user().setDynamicMembership(true);
setup5 = new ExternalSetup(new TestIdentityProvider("idp5"), sc5, new DefaultSyncHandler(sc5), null);
}
Aggregations