Examples of JaasLoginModuleConfiguration


Examples of org.apache.geronimo.security.jaas.server.JaasLoginModuleConfiguration

     * The crucial line is commented out so as to avoid breaking the build.
     *
     * @throws Exception
     */
    public void testMultipleLoginDomains() throws Exception {
        JaasLoginModuleConfiguration m1 = new JaasLoginModuleConfiguration(MockLoginModule.class.getName(), LoginModuleControlFlag.REQUIRED, new HashMap(), true, "D1", true, MockLoginModule.class.getClassLoader());
        JaasLoginModuleConfiguration m2 = new JaasLoginModuleConfiguration(MockLoginModule.class.getName(), LoginModuleControlFlag.REQUIRED, new HashMap(), true, "D2", true, MockLoginModule.class.getClassLoader());
        JaasLoginModuleConfiguration m3 = new JaasLoginModuleConfiguration(AnotherMockLoginModule.class.getName(), LoginModuleControlFlag.REQUIRED, new HashMap(), false, "D3", false, AnotherMockLoginModule.class.getClassLoader());
        JaasLoginModuleConfiguration m4 = new JaasLoginModuleConfiguration(AnotherMockLoginModule.class.getName(), LoginModuleControlFlag.REQUIRED, new HashMap(), false, "D4", true, AnotherMockLoginModule.class.getClassLoader());
        JaasSecuritySession c = new JaasSecuritySession("realm", new JaasLoginModuleConfiguration[]{m1, m2, m3, m4}, new HashMap(), this.getClass().getClassLoader());
        Subject s = c.getSubject();

        c.getLoginModule(0).initialize(s, null, null, null);
        c.getLoginModule(1).initialize(s, null, null, null);
View Full Code Here

Examples of org.apache.geronimo.security.jaas.server.JaasLoginModuleConfiguration

        }

        options.put("realm", realmName);
        options.put("kernel", kernel.getKernelName());

        return new JaasLoginModuleConfiguration(JaasLoginCoordinator.class.getName(), LoginModuleControlFlag.REQUIRED, options, true, applicationConfigName, wrapPrincipals, JaasLoginCoordinator.class.getClassLoader());
    }
View Full Code Here

Examples of org.apache.geronimo.security.jaas.server.JaasLoginModuleConfiguration

        entries.remove(factory.getConfigurationName());
        log.debug("Removed Application Configuration Entry " + factory.getConfigurationName());
    }

    private final void addConfiguration(ConfigurationEntryFactory factory) {
        JaasLoginModuleConfiguration config = factory.generateConfiguration();
        if(config.getLoginDomainName() == null) {
            throw new IllegalArgumentException("A login module to be registered standalone must have a domain name!");
        }
        if (entries.containsKey(factory.getConfigurationName())) {
            throw new java.lang.IllegalArgumentException("ConfigurationEntry already registered");
        }
        AppConfigurationEntry ace = new AppConfigurationEntry(config.getLoginModuleClassName(), config.getFlag().getFlag(), config.getOptions());

        entries.put(factory.getConfigurationName(), ace);
        log.debug("Added Application Configuration Entry " + factory.getConfigurationName());
    }
View Full Code Here

Examples of org.apache.geronimo.security.jaas.server.JaasLoginModuleConfiguration

                throw new IllegalStateException("Error in realm: one security realm cannot contain multiple login modules for the same login domain");
            } else {
                domainNames.add(loginModule.getLoginDomainName());
            }
        }
        JaasLoginModuleConfiguration config = new JaasLoginModuleConfiguration(loginModule.getLoginModuleClass(), controlFlag, options, loginModule.isServerSide(), loginModule.getLoginDomainName(), loginModule.isWrapPrincipals(), loginModule.getClassLoader());
        loginModuleConfigurations.add(config);

        if (next != null) {
            next.configure(domainNames, loginModuleConfigurations, kernel, serverInfo, classLoader);
        }
View Full Code Here

Examples of org.apache.geronimo.security.jaas.server.JaasLoginModuleConfiguration

    /**
     * Strips out stuff that isn't serializable so this can be safely passed to
     * a remote server.
     */
    public static JaasLoginModuleConfiguration getSerializableCopy(JaasLoginModuleConfiguration config) {
        return new JaasLoginModuleConfiguration(config.getLoginModuleClassName(),
                config.getFlag(),
                LoginUtils.getSerializableCopy(config.getOptions()),
                config.isServerSide(),
                config.getLoginDomainName(),
                config.isWrapPrincipals(),
View Full Code Here

Examples of org.apache.geronimo.security.jaas.server.JaasLoginModuleConfiguration

    public String getConfigurationName() {
        return applicationConfigName;
    }

    public JaasLoginModuleConfiguration generateConfiguration() {
        return new JaasLoginModuleConfiguration(module.getLoginModuleClass(), controlFlag, module.getOptions(), module.isServerSide(), applicationConfigName, false, module.getClassLoader());
    }
View Full Code Here

Examples of org.apache.geronimo.security.jaas.server.JaasLoginModuleConfiguration

* @version $Rev: 355877 $ $Date: 2005-12-10 18:48:27 -0800 (Sat, 10 Dec 2005) $
*/
public class NoLoginModuleReuseTest extends TestCase {

    public void testNoLoginModuleReuse() throws Exception {
        JaasLoginModuleConfiguration m1 = new JaasLoginModuleConfiguration(MockLoginModule.class.getName(), LoginModuleControlFlag.REQUIRED, new HashMap(), true, "D1", true, MockLoginModule.class.getClassLoader());
        doSecurityContextLogin(m1);
        doSecurityContextLogin(m1);
    }
View Full Code Here

Examples of org.apache.geronimo.security.jaas.server.JaasLoginModuleConfiguration

        options.put(JaasLoginCoordinator.OPTION_KERNEL, kernel.getKernelName());
        if (loginService != null) {
            options.put(JaasLoginCoordinator.OPTION_SERVICENAME, loginService.getObjectName());
        }

        return new JaasLoginModuleConfiguration(JaasLoginCoordinator.class.getName(), LoginModuleControlFlag.REQUIRED, options, true, realmName, wrapPrincipals, JaasLoginCoordinator.class.getClassLoader());
    }
View Full Code Here

Examples of org.apache.geronimo.security.jaas.server.JaasLoginModuleConfiguration

        }

        options.put("realm", realmName);
        options.put("kernel", kernel.getKernelName());

        return new JaasLoginModuleConfiguration(JaasLoginCoordinator.class.getName(), LoginModuleControlFlag.REQUIRED, options, true, applicationConfigName, wrapPrincipals, JaasLoginCoordinator.class.getClassLoader());
    }
View Full Code Here

Examples of org.apache.geronimo.security.jaas.server.JaasLoginModuleConfiguration

     * The crucial line is commented out so as to avoid breaking the build.
     *
     * @throws Exception
     */
    public void testMultipleLoginDomains() throws Exception {
        JaasLoginModuleConfiguration m1 = new JaasLoginModuleConfiguration(MockLoginModule.class.getName(), LoginModuleControlFlag.REQUIRED, new HashMap(), true, "D1", true, MockLoginModule.class.getClassLoader());
        JaasLoginModuleConfiguration m2 = new JaasLoginModuleConfiguration(MockLoginModule.class.getName(), LoginModuleControlFlag.REQUIRED, new HashMap(), true, "D2", true, MockLoginModule.class.getClassLoader());
        JaasLoginModuleConfiguration m3 = new JaasLoginModuleConfiguration(AnotherMockLoginModule.class.getName(), LoginModuleControlFlag.REQUIRED, new HashMap(), false, "D3", false, AnotherMockLoginModule.class.getClassLoader());
        JaasLoginModuleConfiguration m4 = new JaasLoginModuleConfiguration(AnotherMockLoginModule.class.getName(), LoginModuleControlFlag.REQUIRED, new HashMap(), false, "D4", true, AnotherMockLoginModule.class.getClassLoader());
        JaasSecuritySession c = new JaasSecuritySession("realm", new JaasLoginModuleConfiguration[]{m1, m2, m3, m4}, new HashMap(), this.getClass().getClassLoader());
        Subject s = c.getSubject();

        c.getLoginModule(0).initialize(s, null, null, null);
        c.getLoginModule(1).initialize(s, null, null, null);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.