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 SecurityModule loginModule = new SecurityModule.Builder().name("UsersRoles").build();
            final SecurityDomain sd1 = new SecurityDomain.Builder().name(SECURITY_DOMAIN_XACML).loginModules(loginModule)
                    .authorizationModules(new SecurityModule.Builder().name("XACML").build()) //
                    .build();
            final SecurityDomain sd2 = new SecurityDomain.Builder()
                    .name(SECURITY_DOMAIN_CUSTOM)
                    .loginModules(loginModule)
                    .authorizationModules(
                            new SecurityModule.Builder().name(CustomXACMLAuthorizationModule.class.getName()).build()) //
                    .build();
View Full Code Here


         *
         * @see org.jboss.as.test.integration.security.common.AbstractSecurityDomainsServerSetupTask#getSecurityDomains()
         */
        @Override
        protected SecurityDomain[] getSecurityDomains() {
            final SecurityDomain sd = new SecurityDomain.Builder()
                    .name(SecurityDomain.DEFAULT_NAME)
                    .loginModules(new SecurityModule.Builder().name("UsersRoles").build())
                    .authorizationModules(
                            new SecurityModule.Builder().name(CustomXACMLAuthorizationModule.class.getName()).build()) //
                    .build();
View Full Code Here

         */
        @Override
        protected SecurityDomain[] getSecurityDomains() {
            final SecurityModule.Builder loginModuleBuilder = new SecurityModule.Builder().flag("optional").putOption(
                    "password-stacking", "useFirstPass");
            final SecurityDomain sd = new SecurityDomain.Builder()
                    .name(SECURITY_DOMAIN_NAME)
                    .loginModules(loginModuleBuilder.name(GuestDelegationLoginModule.class.getName()).build(),
                            loginModuleBuilder.name("Remoting").build(), //
                            loginModuleBuilder.name("RealmDirect").build()) //
                    .build();
View Full Code Here

         */
        @Override
        protected SecurityDomain[] getSecurityDomains() {
            final SecurityModule.Builder loginModuleBuilder = new SecurityModule.Builder().flag("optional").putOption(
                    "password-stacking", "useFirstPass");
            final SecurityDomain sd = new SecurityDomain.Builder()
                    .name(SECURITY_DOMAIN_NAME)
                    .loginModules(loginModuleBuilder.name(GuestDelegationLoginModule.class.getName()).build(),
                            loginModuleBuilder.name("Remoting").build(), //
                            loginModuleBuilder.name("RealmDirect").build()) //
                    .build();
View Full Code Here

         *
         * @see org.jboss.as.test.integration.security.common.AbstractSecurityDomainsServerSetupTask#getSecurityDomains()
         */
        @Override
        protected SecurityDomain[] getSecurityDomains() {
            final SecurityDomain sd = new SecurityDomain.Builder().name("form-auth")
                    .loginModules(new SecurityModule.Builder().name("UsersRoles").build()).build();
            return new SecurityDomain[]{sd};
        }
View Full Code Here

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

            final SecurityDomain idp = new SecurityDomain.Builder()
                    .name("idp")
                    .cacheType("default")
                    .loginModules(
                            new SecurityModule.Builder().name("UsersRoles").flag("required")
                                    .putOption("usersProperties", "users.properties")
                                    .putOption("rolesProperties", "roles.properties").build()) //
                    .build();
            final SecurityDomain sp = new SecurityDomain.Builder()
                    .name("sp")
                    .cacheType("default")
                    .loginModules(
                            new SecurityModule.Builder()
                                    .name("org.picketlink.identity.federation.bindings.jboss.auth.SAML2LoginModule")
View Full Code Here

            final Map<String, String> lmOptions = new HashMap<String, String>();
            final Builder loginModuleBuilder = new SecurityModule.Builder().name("UsersRoles").options(lmOptions);

            lmOptions.put("usersProperties", PropertyFilesSetup.FILE_USERS.getAbsolutePath());
            lmOptions.put("rolesProperties", PropertyFilesSetup.FILE_ROLES.getAbsolutePath());
            final SecurityDomain sd1 = new SecurityDomain.Builder().name(DEP1).loginModules(loginModuleBuilder.build()).build();

            lmOptions.remove("usersProperties");
            lmOptions.remove("rolesProperties");
            lmOptions.put("hashAlgorithm", "MD5");
            final SecurityDomain sd2 = new SecurityDomain.Builder().name(DEP2).loginModules(loginModuleBuilder.build()).build();

            lmOptions.put("hashEncoding", "hex");
            final SecurityDomain sd3 = new SecurityDomain.Builder().name(DEP3).loginModules(loginModuleBuilder.build()).build();

            lmOptions.put("hashEncoding", "base64");
            final SecurityDomain sd4 = new SecurityDomain.Builder().name(DEP4).loginModules(loginModuleBuilder.build()).build();

            lmOptions.remove("hashEncoding");
            lmOptions.put("hashUserPassword", "false");
            final SecurityDomain sd5a = new SecurityDomain.Builder().name(DEP5a).loginModules(loginModuleBuilder.build())
                    .build();

            lmOptions.put("hashUserPassword", "true");
            final SecurityDomain sd5b = new SecurityDomain.Builder().name(DEP5b).loginModules(loginModuleBuilder.build())
                    .build();

            lmOptions.put("hashUserPassword", "false");
            lmOptions.put("hashStorePassword", "true");
            final SecurityDomain sd6a = new SecurityDomain.Builder().name(DEP6a).loginModules(loginModuleBuilder.build())
                    .build();

            lmOptions.remove("hashUserPassword");
            final SecurityDomain sd6b = new SecurityDomain.Builder().name(DEP6b).loginModules(loginModuleBuilder.build())
                    .build();

            lmOptions.remove("hashStorePassword");
            lmOptions.remove("hashAlgorithm");
            lmOptions.put("ignorePasswordCase", "true");
            final SecurityDomain sd7a = new SecurityDomain.Builder().name(DEP7a).loginModules(loginModuleBuilder.build())
                    .build();

            lmOptions.put("ignorePasswordCase", "false");
            final SecurityDomain sd7b = new SecurityDomain.Builder().name(DEP7b).loginModules(loginModuleBuilder.build())
                    .build();

            return new SecurityDomain[] { sd1, sd2, sd3, sd4, sd5a, sd5b, sd6a, sd6b, sd7a, sd7b };
        }
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 SecurityDomain spnegoDomain = new SecurityDomain.Builder()
                    .name("SPNEGO")
                    .loginModules(
                            new SecurityModule.Builder().name("SPNEGO").putOption("password-stacking", "useFirstPass")
                                    .putOption("serverSecurityDomain", "host").build()) //
                    .mappingModules(
                            new SecurityModule.Builder().name("SimpleRoles")
                                    .putOption("jduke@JBOSS.ORG", "Admin,Users,JBossAdmin,TestRole").build())//
                    .build();

            final SecurityDomain spnegoWithFallback = new SecurityDomain.Builder()
                    .name("SPNEGO-with-fallback")
                    .loginModules(new SecurityModule.Builder().name("SPNEGO") //
                            .putOption("password-stacking", "useFirstPass") //
                            .putOption("serverSecurityDomain", "host") //
                            .putOption("usernamePasswordDomain", "FORM-as-fallback") //
                            .build())
                    .mappingModules(
                            new SecurityModule.Builder().name("SimpleRoles")
                                    .putOption("jduke@JBOSS.ORG", "Admin,Users,JBossAdmin,TestRole").build())//
                    .build();

            final SecurityDomain formFallbackDomain = new SecurityDomain.Builder().name("FORM-as-fallback")
                    .loginModules(new SecurityModule.Builder().name("UsersRoles") //
                            .putOption("usersProperties", "fallback-users.properties") //
                            .putOption("rolesProperties", "fallback-roles.properties") //
                            .build()).build();
            return new SecurityDomain[] { hostDomain, spnegoDomain, spnegoWithFallback, formFallbackDomain };
View Full Code Here

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

            // A flag indicating if empty (length 0) passwords should be passed to the LDAP server. An empty password is treated
            // as an anonymous login by some LDAP servers and this may not be a desirable feature. To reject empty passwords,
            // set this to false. If set to true, the LDAP server will validate the empty password. The default is true.
            // moduleOptions.put("allowEmptyPasswords","");

            final SecurityDomain sdLdap = new SecurityDomain.Builder()
                    .name(SECURITY_DOMAIN_LDAP)
                    .loginModules(
                            new SecurityModule.Builder().name("Ldap").flag(Constants.SUFFICIENT).options(moduleOptions).build())
                    .build();

            moduleOptions.put("java.naming.provider.url", "ldaps://" + Utils.getSecondaryTestAddress(managementClient) + ":"
                    + LDAPS_PORT);
            final SecurityDomain sdLdaps = new SecurityDomain.Builder()
                    .name(SECURITY_DOMAIN_LDAPS)
                    .loginModules(
                            new SecurityModule.Builder().name("Ldap").flag(Constants.SUFFICIENT).options(moduleOptions).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.