Package org.apache.directory.ldap.client.api

Examples of org.apache.directory.ldap.client.api.LdapConnection.bind()


    @Test
    public void testBindWithDoubleQuote() throws Exception
    {
        LdapConnection connection = new LdapNetworkConnection( "localhost", getLdapServer().getPort() );

        connection.bind( "uid=\"admin\",ou=\"system\"", "secret" );
        assertTrue( connection.isAuthenticated() );
        connection.close();
    }

View Full Code Here


        LdapConnection connection = new LdapNetworkConnection( "localhost", getLdapServer().getPort() );
        connection.setTimeOut( 0 );

        try
        {
            connection.bind( "uid=hacker", "badsecret" );
            fail();
        }
        catch ( LdapAuthenticationException lae )
        {
            //Expected
View Full Code Here

        authInterceptor.setAuthenticators( new Authenticator[]
            { new StrongAuthenticator() } );

        try
        {
            connection.bind( "uid=hacker", "badsecret" );
            fail();
        }
        catch ( LdapAuthenticationException lae )
        {
            //Expected
View Full Code Here

        }

        // Try with an existing user
        try
        {
            connection.bind( "uid=admin,ou=system", "secret" );
            fail();
        }
        catch ( LdapAuthenticationException lae )
        {
            //Expected
View Full Code Here

        assertTrue( getService().isStarted() );
        assertEquals( "DelegatedAuthIT-method", getService().getInstanceId() );
        LdapConnection ldapConnection = new LdapNetworkConnection( "localhost", 10200 );

        ldapConnection.setTimeOut( 0L );
        ldapConnection.bind( "uid=antoine,ou=users,ou=system", "secret" );

        assertTrue( ldapConnection.isAuthenticated() );

        ldapConnection.unBind();
View Full Code Here

        ldapConnection.unBind();

        try
        {
            ldapConnection.bind( "uid=antoine,ou=users,ou=system", "sesame" );
            fail();
        }
        catch ( LdapAuthenticationException lae )
        {
            assertTrue( true );
View Full Code Here

        ldapConnection.unBind();

        try
        {
            ldapConnection.bind( "uid=ivanhoe,ou=users,ou=system", "secret" );
            fail();
        }
        catch ( Exception exc )
        {
            assertTrue( true );
View Full Code Here

    {
        assertTrue( getService().isStarted() );
        assertEquals( "DelegatedAuthIT-MultipleAuthenticators-method", getService().getInstanceId() );
        LdapConnection ldapConnection = new LdapNetworkConnection( "localhost", 10200 );
        ldapConnection.setTimeOut( 0L );
        ldapConnection.bind( "uid=emmanuel,ou=users,ou=system", "sesame" );

        assertTrue( ldapConnection.isAuthenticated() );

        ldapConnection.unBind();
View Full Code Here

        ldapConnection.unBind();

        try
        {
            ldapConnection.bind( "uid=emmanuel,ou=users,ou=system", "crypto" );
            fail();
        }
        catch ( LdapAuthenticationException lae )
        {
            assertTrue( true );
View Full Code Here

        {
            assertTrue( true );
        }

        ldapConnection.unBind();
        ldapConnection.bind();

        assertTrue( ldapConnection.isAuthenticated() );

        ldapConnection.unBind();
        ldapConnection.bind( "uid=antoine,ou=users,ou=system", "secret" );
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.