Package org.apache.harmony.auth.module

Examples of org.apache.harmony.auth.module.JndiLoginModule.initialize()


        status.put("javax.security.auth.login.name", "leo");
        status.put("javax.security.auth.login.password", "faultPass"
                .toCharArray());
        JndiLoginModule module = new JndiLoginModule();
        Subject subject = new Subject();
        module.initialize(subject, new MockCallbackHandler(), status, options);
        try {
            module.login();
            fail("Should be failed for using password from shared state");
        } catch (LoginException e) {
            // expected LoginException here
View Full Code Here


            // expected LoginException here
        }

        options.remove("useFirstPass");
        options.put("tryFirstPass", "true");
        module.initialize(subject, new MockCallbackHandler(), status, options);
        try {
            module.login();
            module.commit();
        } catch (LoginException e) {
            fail("Login should be failed");
View Full Code Here

        options.remove("tryFirstPass");
        options.put("clearPass", "true");
        status.put("javax.security.auth.login.name", "leo");
        status.put("javax.security.auth.login.password", "passw0rd"
                .toCharArray());
        module.initialize(subject, new MockCallbackHandler(), status, options);
        try {
            module.login();
            module.commit();
            assertNull(
                    "javax.security.auth.login.name in shared state should be null when clearPass switch on",
View Full Code Here

        }

        status = new HashMap<String, Object>();
        options.remove("clearPass");
        options.put("storePass", "true");
        module.initialize(subject, new FaultCallbackHandler(), status, options);
        try {
            module.login();
            module.commit();
        } catch (LoginException e) {
            assertNull(
View Full Code Here

                    status.get("javax.security.auth.login.password"));
        } finally {
            module.logout();
        }

        module.initialize(subject, new MockCallbackHandler(), status, options);
        try {
            module.login();
            module.commit();
        } catch (LoginException e) {
            fail("Login failed");
View Full Code Here

                "javax.security.auth.login.password should be stored in shared state when storePass switch on",
                status.get("javax.security.auth.login.password"));

        status.put("javax.security.auth.login.name", "tester");
        status.put("javax.security.auth.login.password", "testerPass");
        module.initialize(subject, new MockCallbackHandler(), status, options);
        try {
            module.login();
            module.commit();
        } 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.