Package org.jboss.as.test.integration.security.common.config

Examples of org.jboss.as.test.integration.security.common.config.SecurityDomain


         * @see org.jboss.as.test.integration.security.common.AbstractSecurityDomainsServerSetupTask#getSecurityDomains()
         */
        @Override
        protected SecurityDomain[] getSecurityDomains() {

            final SecurityDomain sd1 = new SecurityDomain.Builder()
                    .name(SECURITY_DOMAIN_NAME_PREFIX + DEP1)
                    .loginModules(
                            new SecurityModule.Builder()
                                    .name(LdapExtLoginModule.class.getName())
                                    .options(getCommonOptions(buildExtCommand(EXT)+LdapExtLDAPServerSetupTask.SECURITY_CREDENTIALS))
                                    .build())
                    .build();
            final SecurityDomain sd2 = new SecurityDomain.Builder()
                .name(SECURITY_DOMAIN_NAME_PREFIX + DEP2)
                .loginModules(
                        new SecurityModule.Builder()
                                .name("org.jboss.security.auth.spi.LdapExtLoginModule")
                                .options(getCommonOptions(buildExtCommand(EXTC)+LdapExtLDAPServerSetupTask.SECURITY_CREDENTIALS))
                                .build())
            .build();
            final SecurityDomain sd3 = new SecurityDomain.Builder()
                .name(SECURITY_DOMAIN_NAME_PREFIX + DEP3)
                .loginModules(
                        new SecurityModule.Builder()
                                .name("org.jboss.security.auth.spi.LdapExtLoginModule")
                                .options(getCommonOptions(buildExtCommand(EXTC500)+LdapExtLDAPServerSetupTask.SECURITY_CREDENTIALS))
View Full Code Here


                        .putOption("doNotPrompt", TRUE);
            }
            kerberosModuleBuilder.putOption("principal",
                    "HTTP/" + NetworkUtils.formatPossibleIpv6Address(Utils.getCannonicalHost(managementClient)) + "@JBOSS.ORG") //
                    .putOption("debug", TRUE);
            final SecurityDomain hostDomain = new SecurityDomain.Builder().name("host")
                    .loginModules(kerberosModuleBuilder.build()) //
                    .build();
            final SecurityModule spnegoLoginModule = new SecurityModule.Builder().name("SPNEGO")
                    .putOption("password-stacking", "useFirstPass").putOption("serverSecurityDomain", "host").build();
            final SecurityDomain sd1 = new SecurityDomain.Builder()
                    .name(SECURITY_DOMAIN_NAME_PREFIX + DEP1)
                    .loginModules(
                            spnegoLoginModule,
                            new SecurityModule.Builder().name(AdvancedLdapLoginModule.class.getName())
                                    .options(getCommonOptions()) //
                                    .putOption("baseCtxDN", "ou=Users,dc=jboss,dc=org") //
                                    .putOption("baseFilter", "(krb5PrincipalName={0})") //
                                    .putOption("rolesCtxDN", "ou=Roles,dc=jboss,dc=org") //
                                    .putOption("roleFilter", "(member={1})") //
                                    .putOption("roleAttributeID", "cn") //
                                    .build()) //
                    .build();
            final SecurityDomain sd2 = new SecurityDomain.Builder()
                    .name(SECURITY_DOMAIN_NAME_PREFIX + DEP2)
                    .loginModules(
                            spnegoLoginModule,
                            new SecurityModule.Builder().name("AdvancedLdap").options(getCommonOptions())
                                    .putOption("baseCtxDN", "ou=Users,dc=jboss,dc=org") //
                                    .putOption("baseFilter", "(krb5PrincipalName={0})") //
                                    .putOption("rolesCtxDN", "ou=Roles,o=example2,dc=jboss,dc=org") //
                                    .putOption("roleFilter", "(postalAddress={0})") //
                                    .putOption("roleAttributeID", "description") //
                                    .putOption("roleAttributeIsDN", TRUE) //
                                    .putOption("roleNameAttributeID", "cn") //
                                    //                                    .putOption("roleRecursion", "0") //
                                    .build()) //
                    .build();
            final SecurityDomain sd3 = new SecurityDomain.Builder()
                    .name(SECURITY_DOMAIN_NAME_PREFIX + DEP3)
                    .loginModules(
                            spnegoLoginModule,
                            new SecurityModule.Builder().name(AdvancedLdapLoginModule.class.getName())
                                    .options(getCommonOptions()) //
                                    .putOption("baseCtxDN", "ou=Users,dc=jboss,dc=org") //
                                    .putOption("baseFilter", "(mail={0})") //
                                    .putOption("rolesCtxDN", "ou=Roles,o=example3,dc=jboss,dc=org") //
                                    .putOption("roleFilter", "(member={1})") //
                                    .putOption("roleAttributeID", "cn") //
                                    //                                    .putOption("roleRecursion", "0") //
                                    .build()) //
                    .build();
            final SecurityDomain sd4 = new SecurityDomain.Builder()
                    .name(SECURITY_DOMAIN_NAME_PREFIX + DEP4)
                    .loginModules(
                            spnegoLoginModule,
                            new SecurityModule.Builder().name(AdvancedLdapLoginModule.class.getName())
                                    .options(getCommonOptions()) //
View Full Code Here

         */
        @Override
        protected SecurityDomain[] getSecurityDomains() {
            final SecurityModule.Builder loginModuleBuilder = new SecurityModule.Builder().name("Database").options(
                    getLoginModuleOptions());
            final SecurityDomain sd1 = new SecurityDomain.Builder().name(DB).loginModules(loginModuleBuilder.build()).build();
            return new SecurityDomain[] { sd1 };
        }
View Full Code Here

         */
        @Override
        protected SecurityDomain[] getSecurityDomains() {
            final SecurityModule.Builder loginModuleBuilder = new SecurityModule.Builder().name("Database").options(
                    getLoginModuleOptions(DEP1));
            final SecurityDomain sd1 = new SecurityDomain.Builder().name(DEP1).loginModules(loginModuleBuilder.build()).build();
            loginModuleBuilder.options(getLoginModuleOptions(DEP2)).putOption("hashAlgorithm", MD5);
            final SecurityDomain sd2 = new SecurityDomain.Builder().name(DEP2).loginModules(loginModuleBuilder.build()).build();
            loginModuleBuilder.options(getLoginModuleOptions(DEP3)).putOption("hashAlgorithm", MD5)
                    .putOption("hashEncoding", "base64");
            final SecurityDomain sd3 = new SecurityDomain.Builder().name(DEP3).loginModules(loginModuleBuilder.build()).build();
            loginModuleBuilder.options(getLoginModuleOptions(DEP4)).putOption("hashAlgorithm", MD5)
                    .putOption("hashEncoding", "hex");
            final SecurityDomain sd4 = new SecurityDomain.Builder().name(DEP4).loginModules(loginModuleBuilder.build()).build();
            return new SecurityDomain[] { sd1, sd2, sd3, sd4 };
        }
View Full Code Here

            //        </login-module>
            //    </authentication>
            //</security-domain>
            final SecurityModule.Builder loginModuleBuilder = new SecurityModule.Builder().putOption("password-stacking",
                    "useFirstPass");
            final SecurityDomain sd = new SecurityDomain.Builder()
                    .name(TEST_NAME)
                    .loginModules(
                            loginModuleBuilder.name("Remoting").flag("optional").build(), //
                            loginModuleBuilder.name("RealmUsersRoles").flag("required")
                                    .putOption("usersProperties", USERS_FILE.getAbsolutePath())
View Full Code Here

         */
        @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())
View Full Code Here

         *
         * @see org.jboss.as.test.integration.security.common.AbstractSecurityDomainsServerSetupTask#getSecurityDomains()
         */
        @Override
        protected SecurityDomain[] getSecurityDomains() throws Exception {
            final SecurityDomain sd = new SecurityDomain.Builder()
                    .name(SECURITY_DOMAIN_CERT)
                    .loginModules(
                            new SecurityModule.Builder().name(CertRolesLoginModule.class.getName())
                                    .putOption("securityDomain", SECURITY_DOMAIN_JSSE).putOption("password-stacking", "useFirstPass")
                                    .putOption("rolesProperties", "roles.properties").build()).build();
            final SecurityDomain sdJsse = new SecurityDomain.Builder()
                    .name(SECURITY_DOMAIN_JSSE)
                    .jsse(new JSSE.Builder().trustStore(
                            new SecureStore.Builder().type("JKS").url(SERVER_TRUSTSTORE_FILE.toURI().toURL())
                                    .password(SecurityTestConstants.KEYSTORE_PASSWORD).build()) //
                            .build()) //
View Full Code Here

         *
         * @see org.jboss.as.test.integration.security.common.AbstractSecurityDomainsServerSetupTask#getSecurityDomains()
         */
        @Override
        protected SecurityDomain[] getSecurityDomains() throws Exception {
            final SecurityDomain sd = new SecurityDomain.Builder()
                    .name(SECURITY_DOMAIN_CERT)
                    .loginModules(
                            new SecurityModule.Builder().name(DatabaseCertLoginModule.class.getName())
                                    .putOption("securityDomain", SECURITY_DOMAIN_JSSE).putOption("password-stacking", "useFirstPass")
                                    .putOption("dsJndiName", "java:jboss/datasources/" + DATASOURCE_NAME)
                                    .putOption("rolesQuery", "select Role, RoleGroup from Roles where PrincipalID=?").build()).build();
            final SecurityDomain sdJsse = new SecurityDomain.Builder()
                    .name(SECURITY_DOMAIN_JSSE)
                    .jsse(new JSSE.Builder().trustStore(
                            new SecureStore.Builder().type("JKS").url(SERVER_TRUSTSTORE_FILE.toURI().toURL())
                                    .password(SecurityTestConstants.KEYSTORE_PASSWORD).build()) //
                            .build()) //
View Full Code Here

        protected SecurityDomain[] getSecurityDomains() {
            final Builder realmDirectLMBuilder = new SecurityModule.Builder().name("RealmDirect");
            final SecurityModule mappingModule = new SecurityModule.Builder().name("SimpleRoles").putOption("jduke", "Admin")
                    .build();

            final SecurityDomain sd1 = new SecurityDomain.Builder().name(LDAPS_AUTHN_SD)
                    .loginModules(realmDirectLMBuilder.putOption("realm", LDAPS_AUTHN_REALM).build())
                    .mappingModules(mappingModule).build();
            final SecurityDomain sd2 = new SecurityDomain.Builder().name(LDAPS_AUTHN_SD_NO_SSL)
                    .loginModules(realmDirectLMBuilder.putOption("realm", LDAPS_AUTHN_REALM_NO_SSL).build())
                    .mappingModules(mappingModule).build();
            return new SecurityDomain[]{sd1, sd2};
        }
View Full Code Here

        private static final SecurityDomainsSetup INSTANCE = new SecurityDomainsSetup();

        @Override
        protected SecurityDomain[] getSecurityDomains() throws Exception {
            final SecurityDomain sd = new SecurityDomain.Builder()
                    .name(SECURITY_DOMAIN_CERT)
                    .loginModules(
                            new SecurityModule.Builder().name(BaseCertLoginModule.class.getName())
                                    .putOption("securityDomain", SECURITY_DOMAIN_JSSE)
                                    .putOption("password-stacking", "useFirstPass").build(),
                            new SecurityModule.Builder().name(AddRoleLoginModule.class.getName()).flag("optional")
                                    .putOption("password-stacking", "useFirstPass")
                                    .putOption("roleName", SimpleSecuredServlet.ALLOWED_ROLE).build()) //
                    .build();
            final SecurityDomain sdJsse = new SecurityDomain.Builder()
                    .name(SECURITY_DOMAIN_JSSE)
                    .jsse(new JSSE.Builder().trustStore(
                            new SecureStore.Builder().type("JKS").url(SERVER_TRUSTSTORE_FILE.toURI().toURL())
                                    .password(SecurityTestConstants.KEYSTORE_PASSWORD).build()) //
                            .build()) //
View Full Code Here

TOP

Related Classes of org.jboss.as.test.integration.security.common.config.SecurityDomain

Copyright © 2018 www.massapicom. 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.