Package org.apache.harmony.auth.module

Examples of org.apache.harmony.auth.module.Krb5LoginModule


     * TODO
     */
    public void test_Config() throws Exception {

        // create login module for testing
        Krb5LoginModule module = new Krb5LoginModule();
        module.initialize(null, new MockCallbackHandler(), null, options);

        // case 1: unset 'kdc' and set 'real' sys.props
        TestUtils.setSystemProperty(ENV_KDC, null);
        TestUtils.setSystemProperty(ENV_REALM, "some_value");
        try {
            module.login();
            fail("No expected LoginException");
        } catch (LoginException e) {
        }

        // case 2: set 'kdc' and unset 'real' sys.props
        TestUtils.setSystemProperty(ENV_KDC, "some_value");
        TestUtils.setSystemProperty(ENV_REALM, null);
        try {
            module.login();
            fail("No expected LoginException");
        } catch (LoginException e) {
        }

        //TODO: test reading config from configuration file 'krb5.conf'
View Full Code Here


        if (server != null) {
            server.respond = KerberosErrorMessageTest.err_resp;
        }

        Krb5LoginModule module = new Krb5LoginModule();

        options.put("principal", "no_such_user");

        module.initialize(null, null, null, options);
        try {
            module.login();
            fail("No expected LoginException");
        } catch (LoginException e) {
            System.out.println(e);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.harmony.auth.module.Krb5LoginModule

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.