*/
@Override
protected SecurityDomain[] getSecurityDomains() {
final String secondaryTestAddress = Utils.getSecondaryTestAddress(managementClient);
final String lmClassName = AdvancedLdapLoginModule.class.getName();
final SecurityDomain sd1 = new SecurityDomain.Builder()
.name(SECURITY_DOMAIN_NAME_PREFIX + DEP1)
.loginModules(
new SecurityModule.Builder()
.name(lmClassName)
.options(getCommonOptions())
.putOption(Context.REFERRAL, "follow")
.putOption("baseCtxDN", "ou=People,dc=jboss,dc=org")
.putOption("java.naming.provider.url",
"ldap://" + secondaryTestAddress + ":" + LdapExtLDAPServerSetupTask.LDAP_PORT)
.putOption("baseFilter", "(|(objectClass=referral)(uid={0}))")
.putOption("rolesCtxDN", "ou=Roles,dc=jboss,dc=org")
.putOption("roleFilter", "(|(objectClass=referral)(member={1}))")
.putOption("roleAttributeID", "cn")
.putOption("referralUserAttributeIDToCheck", "member")
.build()) //
.build();
final SecurityModule.Builder sd2LoginModuleBuilder = new SecurityModule.Builder()
.name(lmClassName)
.options(getCommonOptions())
.putOption(Context.REFERRAL, "ignore")
.putOption("java.naming.provider.url",
"ldap://" + secondaryTestAddress + ":" + LdapExtLDAPServerSetupTask.LDAP_PORT)
.putOption("baseCtxDN", "ou=People,o=example2,dc=jboss,dc=org").putOption("baseFilter", "(uid={0})")
.putOption("rolesCtxDN", "ou=Roles,o=example2,dc=jboss,dc=org")
.putOption("roleFilter", "(|(objectClass=referral)(cn={0}))").putOption("roleAttributeID", "description")
.putOption("roleAttributeIsDN", "true").putOption("roleNameAttributeID", "cn");
final SecurityDomain sd2 = new SecurityDomain.Builder().name(SECURITY_DOMAIN_NAME_PREFIX + DEP2)
.loginModules(sd2LoginModuleBuilder.build()).build();
sd2LoginModuleBuilder
.putOption(Context.REFERRAL, "throw")
.putOption("referralUserAttributeIDToCheck", "cn");
final SecurityDomain sd2throw = new SecurityDomain.Builder().name(SECURITY_DOMAIN_NAME_PREFIX + DEP2_THROW)
.loginModules(sd2LoginModuleBuilder.build()).build();
final SecurityDomain sd3 = new SecurityDomain.Builder()
.name(SECURITY_DOMAIN_NAME_PREFIX + DEP3)
.loginModules(
new SecurityModule.Builder()
.name(lmClassName)
.options(getCommonOptions())
.putOption(Context.REFERRAL, "follow")
.putOption("java.naming.provider.url",
"ldaps://" + secondaryTestAddress + ":" + LdapExtLDAPServerSetupTask.LDAPS_PORT)
.putOption("baseCtxDN", "ou=People,o=example3,dc=jboss,dc=org")
.putOption("baseFilter", "(|(objectClass=referral)(cn={0}))")
.putOption("rolesCtxDN", "ou=Roles,o=example3,dc=jboss,dc=org")
.putOption("roleFilter", "(|(objectClass=referral)(member={1}))")
.putOption("roleAttributeID", "cn")
.putOption("referralUserAttributeIDToCheck", "member")
.build()) //
.build();
final SecurityDomain sd4 = new SecurityDomain.Builder()
.name(SECURITY_DOMAIN_NAME_PREFIX + DEP4)
.loginModules(
new SecurityModule.Builder()
.name(lmClassName)
.options(getCommonOptions())
.putOption(Context.REFERRAL, "ignore")
.putOption("java.naming.provider.url",
"ldaps://" + secondaryTestAddress + ":" + LdapExtLDAPServerSetupTask.LDAPS_PORT)
.putOption("baseCtxDN", "ou=People,o=example4,dc=jboss,dc=org")
.putOption("baseFilter", "(employeeNumber={0})")
.putOption("rolesCtxDN", "ou=Roles,o=example4,dc=jboss,dc=org")
.putOption("roleFilter", "(|(objectClass=referral)(member={1}))")
.putOption("roleAttributeID", "cn").putOption("recurseRoles", "true").build()) //
.build();
final SecurityDomain sd4_direct = new SecurityDomain.Builder()
.name(SECURITY_DOMAIN_NAME_PREFIX + DEP4_DIRECT)
.loginModules(
new SecurityModule.Builder()
.name(lmClassName)
.options(getCommonOptions())
.putOption(Context.REFERRAL, "ignore")
.putOption("java.naming.provider.url",
"ldap://" + secondaryTestAddress + ":" + LdapExtLDAPServerSetupTask.LDAP_PORT)
.putOption("baseCtxDN", "ou=People,o=example4,dc=jboss,dc=org")
.putOption("baseFilter", "(uid={0})").putOption("roleAttributeIsDN", "true")
.putOption("roleNameAttributeID", "cn").putOption("roleAttributeID", "description")
.putOption("recurseRoles", "true").build()) //
.build();
final SecurityDomain sd5 = new SecurityDomain.Builder()
.name(SECURITY_DOMAIN_NAME_PREFIX + DEP5)
.loginModules(
new SecurityModule.Builder()
.name(lmClassName)
.options(getCommonOptions())