Examples of reconnect()


Examples of javax.naming.ldap.InitialLdapContext.reconnect()

        server.setResponseSeq(new LdapMessage[] { new LdapMessage(
                LdapASN1Constant.OP_BIND_RESPONSE, new BindResponse(), null) });

        // doesn't create new connection
        context.reconnect(null);

        server.setResponseSeq(new LdapMessage[] { new LdapMessage(
                LdapASN1Constant.OP_SEARCH_RESULT_DONE,
                new EncodableLdapResult(), null) });
        // another and context share the same connection now
View Full Code Here

Examples of javax.naming.ldap.InitialLdapContext.reconnect()

        one.start();

        one.setResponseSeq(new LdapMessage[] { new LdapMessage(
                LdapASN1Constant.OP_BIND_RESPONSE, new BindResponse(), null) });
        // create new connection
        context.reconnect(null);

        server.setResponseSeq(new LdapMessage[] { new LdapMessage(
                LdapASN1Constant.OP_BIND_RESPONSE, new BindResponse(), null) });
        // use original connection
        another.reconnect(null);
View Full Code Here

Examples of javax.naming.ldap.LdapContext.reconnect()

        // -------------------------------------------------------------------

        ctx.addToEnvironment( Context.SECURITY_PRINCIPAL, "uid=admin,ou=system" );
        ctx.addToEnvironment( Context.SECURITY_CREDENTIALS, "secret" );
        ctx.addToEnvironment( Context.SECURITY_AUTHENTICATION, "simple" );
        ctx.reconnect( null );
       
        // -------------------------------------------------------------------
        // do a search and confirm
        // -------------------------------------------------------------------
View Full Code Here

Examples of javax.naming.ldap.LdapContext.reconnect()

        Control[] rctls = { new PasswordPolicyControl(false) };

        try {
            ctx.addToEnvironment(Context.SECURITY_PRINCIPAL, principal );
            ctx.addToEnvironment(Context.SECURITY_CREDENTIALS, credentials);
            ctx.reconnect(rctls);
        } catch(javax.naming.NamingException ne) {
            PasswordPolicyResponseControl ctrl = PasswordPolicyControlExtractor.extractControl(ctx);
            if (debug) {
                logger.debug("Failed to obtain context", ne);
                logger.debug("Password policy response: " + ctrl);
View Full Code Here

Examples of javax.naming.ldap.LdapContext.reconnect()

                ctx.removeFromEnvironment("com.sun.jndi.ldap.connect.pool");
                ctx.addToEnvironment(Context.SECURITY_PRINCIPAL, LdapUtils.getFullDn(dn, ctx).toString());
                ctx.addToEnvironment(Context.SECURITY_CREDENTIALS, oldPassword);
                // TODO: reconnect doesn't appear to actually change the credentials
                try {
                    ctx.reconnect(null);
                } catch (javax.naming.AuthenticationException e) {
                    throw new BadCredentialsException("Authentication for password change failed.");
                }

                ctx.modifyAttributes(dn, passwordChange);
View Full Code Here

Examples of javax.naming.ldap.LdapContext.reconnect()

        // Authenticate via SASL EXTERNAL mechanism using client X.509
        // certificate contained in JVM keystore
        ctx.addToEnvironment(Context.SECURITY_AUTHENTICATION, "simple");
        ctx.addToEnvironment(Context.SECURITY_PRINCIPAL, getUserDN(inBenutzer));
        ctx.addToEnvironment(Context.SECURITY_CREDENTIALS, inPasswort);
        ctx.reconnect(null);
        return true;
        // Perform search for privileged attributes under authenticated context

      } catch (IOException e) {
        myLogger.error("TLS negotiation error:", e);
View Full Code Here

Examples of javax.naming.ldap.LdapContext.reconnect()

        // certificate contained in JVM keystore
        ctx.addToEnvironment(Context.SECURITY_AUTHENTICATION, "simple");
        ctx.addToEnvironment(Context.SECURITY_PRINCIPAL, ConfigMain.getParameter("ldap_adminLogin"));
        ctx.addToEnvironment(Context.SECURITY_CREDENTIALS, ConfigMain.getParameter("ldap_adminPassword"));

        ctx.reconnect(null);

        Attributes attrs = ctx.getAttributes(getUserDN(inBenutzer));
        Attribute la = attrs.get("homeDirectory");
        return (String) la.get(0);
View Full Code Here

Examples of javax.naming.ldap.LdapContext.reconnect()

        // -------------------------------------------------------------------

        ctx.addToEnvironment( Context.SECURITY_PRINCIPAL, "uid=admin,ou=system" );
        ctx.addToEnvironment( Context.SECURITY_CREDENTIALS, "secret" );
        ctx.addToEnvironment( Context.SECURITY_AUTHENTICATION, "simple" );
        ctx.reconnect( null );

        // -------------------------------------------------------------------
        // do a search and confirm
        // -------------------------------------------------------------------
View Full Code Here

Examples of javax.naming.ldap.LdapContext.reconnect()

        assertNull(context.getConnectControls());

        server.setResponseSeq(new LdapMessage[] { new LdapMessage(
                LdapASN1Constant.OP_BIND_RESPONSE, new BindResponse(), null) });
        context.reconnect(new Control[] { new SortControl("",
                Control.NONCRITICAL) });

        Control[] controls = context.getConnectControls();
        assertNotNull(controls);
        assertEquals(1, controls.length);
View Full Code Here

Examples of javax.naming.ldap.LdapContext.reconnect()

        server = new MockLdapServer(server);
        server.start();
        server.setResponseSeq(new LdapMessage[] { new LdapMessage(
                LdapASN1Constant.OP_BIND_RESPONSE, new BindResponse(), null) });

        context.reconnect(new Control[] { new SortControl("",
                Control.NONCRITICAL) });

        Control[] controls = context.getConnectControls();
        assertNotNull(controls);
        assertEquals(1, controls.length);
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.