* @see org.jboss.as.test.integration.security.common.AbstractSecurityDomainsServerSetupTask#getSecurityDomains()
*/
@Override
protected SecurityDomain[] getSecurityDomains() {
final String secondaryTestAddress = Utils.getSecondaryTestAddress(managementClient);
final SecurityDomain sd1 = new SecurityDomain.Builder()
.name(SECURITY_DOMAIN_NAME_PREFIX + DEP1)
.loginModules(
new SecurityModule.Builder()
.name("org.jboss.security.auth.spi.LdapExtLoginModule")
.options(getCommonOptions())
.putOption(Context.REFERRAL, "follow")
.putOption("baseCtxDN", "ou=People,dc=jboss,dc=org")
.putOption(
"java.naming.provider.url",
"ldap://"
+ secondaryTestAddress
+ ":"
+ org.jboss.as.test.integration.security.loginmodules.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("LdapExtended")
.options(getCommonOptions())
.putOption(Context.REFERRAL, "ignore")
.putOption(
"java.naming.provider.url",
"ldap://" + secondaryTestAddress + ":"
+ org.jboss.as.test.integration.security.loginmodules.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")
.putOption("roleRecursion", "0");
final SecurityDomain sd2 = new SecurityDomain.Builder().name(SECURITY_DOMAIN_NAME_PREFIX + DEP2)
.loginModules(sd2LoginModuleBuilder.build()).build();
sd2LoginModuleBuilder.putOption(Context.REFERRAL, "throw")
.putOption("referralUserAttributeIDToCheck", "member");
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(LdapExtLoginModule.class.getName())
.options(getCommonOptions())
.putOption(Context.REFERRAL, "follow")
.putOption(
"java.naming.provider.url",
"ldaps://"
+ secondaryTestAddress
+ ":"
+ org.jboss.as.test.integration.security.loginmodules.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("roleRecursion", "0")
.putOption("referralUserAttributeIDToCheck", "member")
.build()) //
.build();
final SecurityDomain sd4 = new SecurityDomain.Builder()
.name(SECURITY_DOMAIN_NAME_PREFIX + DEP4)
.loginModules(
new SecurityModule.Builder()
.name(LdapExtLoginModule.class.getName())
.options(getCommonOptions())
.putOption(Context.REFERRAL, "ignore")
.putOption(
"java.naming.provider.url",
"ldaps://"
+ secondaryTestAddress
+ ":"
+ org.jboss.as.test.integration.security.loginmodules.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("roleRecursion", "1").build()) //
.build();
final SecurityDomain sd4_direct = new SecurityDomain.Builder()
.name(SECURITY_DOMAIN_NAME_PREFIX + DEP4_DIRECT)
.loginModules(
new SecurityModule.Builder()
.name(LdapExtLoginModule.class.getName())
.options(getCommonOptions())
.putOption(Context.REFERRAL, "ignore")
.putOption(
"java.naming.provider.url",
"ldap://"
+ secondaryTestAddress
+ ":"
+ org.jboss.as.test.integration.security.loginmodules.LdapExtLDAPServerSetupTask.LDAP_PORT)
.putOption("baseCtxDN", "o=example4,dc=jboss,dc=org") //
.putOption("baseFilter", "(uid={0})") //
.putOption("rolesCtxDN", "o=example4,dc=jboss,dc=org") //
.putOption("roleFilter", "(cn={0})") //
.putOption("roleAttributeIsDN", "true") //
.putOption("roleAttributeID", "description") //
.putOption("roleNameAttributeID", "cn") //
.putOption("roleRecursion", "5").build()) //
.build();
final SecurityDomain sd5 = new SecurityDomain.Builder()
.name(SECURITY_DOMAIN_NAME_PREFIX + DEP5)
.loginModules(
new SecurityModule.Builder()
.name(LdapExtLoginModule.class.getName())
.options(getCommonOptions())