Package org.apache.felix.jaas.integration.common

Examples of org.apache.felix.jaas.integration.common.SimpleCallbackHandler


        delay();

        //2. Validate the login passes with this config. LoginModule would validate
        //the config also
        CallbackHandler handler = new SimpleCallbackHandler("foo","foo");
        Configuration jaasConfig = Configuration.getInstance("JavaLoginConfig",null,"FelixJaasProvider");

        Subject s = new Subject();
        final ClassLoader cl = Thread.currentThread().getContextClassLoader();
        try
View Full Code Here


        dict.put("jaas.classname", "org.apache.felix.jaas.integration.sample1.ConfigLoginModule");

        config.update(dict);
        delay();

        CallbackHandler handler = new SimpleCallbackHandler("foo","foo");

        Subject s = new Subject();
        LoginContext lc = loginContextFactory.createLoginContext(realmName, s, handler);
        lc.login();
View Full Code Here

    {
        String realmName = name.getMethodName();
        createLoginModuleConfig(realmName);
        delay();

        CallbackHandler handler = new SimpleCallbackHandler("foo", "foo");
        Configuration config = Configuration.getInstance("JavaLoginConfig", null,"FelixJaasProvider");
        Subject s = new Subject();

        LoginContext lc = new LoginContext(realmName, s, handler, config);
        lc.login();
View Full Code Here

        p2.setProperty("jaas.globalConfigPolicy","replace");
        config2.update(p2);

        delay();

        CallbackHandler handler = new SimpleCallbackHandler("foo", "foo");
        Subject s = new Subject();

        //2. Now just do normal JAAS Login. No change of TCCL and no fetching of explicit config

        LoginContext lc = new LoginContext(realmName, s, handler);
View Full Code Here

        p2.setProperty("jaas.globalConfigPolicy","replace");
        config2.update(p2);
        delay();

        //2. Validate the login passes with this config. Would not pass explicit config
        CallbackHandler handler = new SimpleCallbackHandler("foo","foo");

        Subject s = new Subject();
        final ClassLoader cl = Thread.currentThread().getContextClassLoader();
        try
        {
View Full Code Here

    public void testJaasWithTCCL() throws Exception {
        String realmName = name.getMethodName();
        createLoginModuleConfig(realmName);
        delay();

        CallbackHandler handler = new SimpleCallbackHandler("foo","foo");
        Configuration config = Configuration.getInstance("JavaLoginConfig",null,"FelixJaasProvider");

        Subject s = new Subject();
        final ClassLoader cl = Thread.currentThread().getContextClassLoader();
        try
View Full Code Here

    {
        String realmName = name.getMethodName();
        createLoginModuleConfig(realmName);
        delay();

        CallbackHandler handler = new SimpleCallbackHandler("foo", "foo");

        Subject s = new Subject();

        //Using LoginFactory we can avoid providing Configuration and switching TCCL
        LoginContext lc = loginContextFactory.createLoginContext(realmName, s, handler);
        lc.login();

        assertFalse(s.getPrincipals().isEmpty());

        //Negative case. Login fails with incorrect password
        try
        {
            LoginContext lc2 = loginContextFactory.createLoginContext(realmName, s,
                    new SimpleCallbackHandler("foo", "bar"));
            lc2.login();
            fail("Login should have failed");
        }catch(LoginException e){

        }
View Full Code Here

TOP

Related Classes of org.apache.felix.jaas.integration.common.SimpleCallbackHandler

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.