Examples of UsernamePasswordCallbackHandler


Examples of org.apache.openejb.core.security.jaas.UsernamePasswordCallbackHandler

        }
        //System.out.println("Path to login config: " + path);
    }

    public void testLogin() throws LoginException {
        final LoginContext context = new LoginContext("PropertiesLogin", new UsernamePasswordCallbackHandler("jonathan", "secret"));
        context.login();

        final Subject subject = context.getSubject();

        assertEquals("Should have three principals", 3, subject.getPrincipals().size());
View Full Code Here

Examples of org.apache.openejb.core.security.jaas.UsernamePasswordCallbackHandler

        assertEquals("Should have zero principals", 0, subject.getPrincipals().size());
    }

    public void testBadUseridLogin() throws Exception {
        final LoginContext context = new LoginContext("PropertiesLogin", new UsernamePasswordCallbackHandler("nobody", "secret"));
        try {
            context.login();
            fail("Should have thrown a FailedLoginException");
        } catch (final FailedLoginException doNothing) {
        }
View Full Code Here

Examples of org.apache.openejb.core.security.jaas.UsernamePasswordCallbackHandler

        }

    }

    public void testBadPWLogin() throws Exception {
        final LoginContext context = new LoginContext("PropertiesLogin", new UsernamePasswordCallbackHandler("jonathan", "badpass"));
        try {
            context.login();
            fail("Should have thrown a FailedLoginException");
        } catch (final FailedLoginException doNothing) {
        }
View Full Code Here

Examples of org.apache.openejb.core.security.jaas.UsernamePasswordCallbackHandler

        return beans;
    }

    @Test
    public void testLogin() throws LoginException {
        final LoginContext context = new LoginContext("CDI", new UsernamePasswordCallbackHandler("foo", ""));
        context.login();

        final Subject subject = context.getSubject();

        assertEquals(1, subject.getPrincipals().size());
View Full Code Here

Examples of org.apache.openejb.core.security.jaas.UsernamePasswordCallbackHandler

        assertEquals(0, subject.getPrincipals().size());
    }

    @Test(expected = LoginException.class)
    public void testBadUseridLogin() throws Exception {
        new LoginContext("CDI", new UsernamePasswordCallbackHandler("bar", "secret")).login();
    }
View Full Code Here

Examples of org.apache.openejb.core.security.jaas.UsernamePasswordCallbackHandler

            }
        }
    }

    public void testLogin() throws LoginException {
        final LoginContext context = new LoginContext("ServiceProviderLogin", new UsernamePasswordCallbackHandler("paul", ""));
        context.login();

        final Subject subject = context.getSubject();

        assertEquals("Should have three principals", 3, subject.getPrincipals().size());
View Full Code Here

Examples of org.apache.openejb.core.security.jaas.UsernamePasswordCallbackHandler

        assertEquals("Should have zero principals", 0, subject.getPrincipals().size());
    }

    public void testBadUseridLogin() throws Exception {
        final LoginContext context = new LoginContext("ServiceProviderLogin", new UsernamePasswordCallbackHandler("nobody", "secret"));
        try {
            context.login();
            fail("Should have thrown a FailedLoginException");
        } catch (final FailedLoginException doNothing) {
        }
View Full Code Here

Examples of org.apache.openejb.core.security.jaas.UsernamePasswordCallbackHandler

        }

    }

    public void testBadPWLogin() throws Exception {
        final LoginContext context = new LoginContext("ServiceProviderLogin", new UsernamePasswordCallbackHandler("eddie", "panama"));
        try {
            context.login();
            fail("Should have thrown a FailedLoginException");
        } catch (final FailedLoginException doNothing) {
        }
View Full Code Here

Examples of org.apache.openejb.core.security.jaas.UsernamePasswordCallbackHandler

    }

    @Test
    public void testLogin() throws LoginException {
        final LoginContext context = new LoginContext("SQLLogin",
            new UsernamePasswordCallbackHandler("jonathan", "secret"));
        context.login();

        final Subject subject = context.getSubject();

        assertEquals("Should have three principals", 3,
View Full Code Here

Examples of org.apache.openejb.core.security.jaas.UsernamePasswordCallbackHandler

    }

    @Test(expected = FailedLoginException.class)
    public void testBadUseridLogin() throws LoginException {
        final LoginContext context = new LoginContext("SQLLogin",
            new UsernamePasswordCallbackHandler("nobody", "secret"));
        context.login();
    }
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.