Examples of JaasLoginModuleConfiguration


Examples of org.apache.geronimo.security.jaas.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);
    }
View Full Code Here

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

        Map options = new HashMap();

        // TODO: This can be a bad thing, passing a reference to a realm to the login module
        // since the SerializableACE can be sent remotely
        options.put(REALM_INSTANCE, this);
        JaasLoginModuleConfiguration config = new JaasLoginModuleConfiguration(PasswordCredentialLoginModule.class.getName(),
                                                                               LoginModuleControlFlag.REQUISITE, options, true, getRealmName());
        return new JaasLoginModuleConfiguration[]{config};
    }
View Full Code Here

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

    public JaasLoginModuleConfiguration generateConfiguration() {
        Map options = new HashMap();
        options.put("realm", realmName);
        options.put("kernel", kernel.getKernelName());

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

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

    public JaasLoginModuleConfiguration generateConfiguration() {
        Map options = new HashMap();
        options.put("realm", realmName);
        options.put("kernel", kernel.getKernelName());

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

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

                //this can be used for testing without a kernel.
                options.put(JaasLoginCoordinator.OPTION_SERVICE_INSTANCE, loginService);
            }
        }

        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

* @version $Rev: 355877 $ $Date: 2005-12-11 03:48:27 +0100 (Sun, 11 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

        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

     * 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

                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
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.