Package org.apache.harmony.auth.module

Examples of org.apache.harmony.auth.module.LdapLoginModule.login()


        options.put("authIdentity","cn=Manager,dc=my-domain,dc=com");
        Subject subject = new Subject();
        module.initialize(subject, new MockCallbackHandler(), null, options);
        try {
            assertTrue("Login should be successful", module.login());
        } catch (LoginException e) {
            fail("Login shouldn't fail");
        }
        module.initialize(subject, new FaultCallbackHandler(), null, options);
        try {
View Full Code Here


        } catch (LoginException e) {
            fail("Login shouldn't fail");
        }
        module.initialize(subject, new FaultCallbackHandler(), null, options);
        try {
            assertFalse("Login shouldn't be successful", module.login());
            fail("Login should fail");
        } catch (LoginException e) {
            // expected Loginexception here
        }
    }
View Full Code Here

        LdapLoginModule module = new LdapLoginModule();
        Subject subject = new Subject();
        options.put("authIdentity","cn=Manager,dc=my-domain,dc=com");
        module.initialize(subject, new MockCallbackHandler(), null, options);
        try {
            assertTrue("Login should be successful", module.login());
            module.commit();
        } catch (LoginException e) {
            fail("Login shouldn't fail");
        }
        Set<Principal> principals = subject.getPrincipals();
View Full Code Here

        options.put("authzIdentity","testAuthzIdentityOption");
        LdapLoginModule module = new LdapLoginModule();
        Subject subject = new Subject();
        module.initialize(subject, new MockCallbackHandler(), null, options);
        try {
            module.login();
            module.commit();
            assertTrue("Should get a principal from authzIdentity option",subject.getPrincipals().contains(new UserPrincipal("testAuthzIdentityOption")));
        }
        catch(LoginException e){
            fail("Login failed");
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.