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

Examples of org.apache.directory.ldap.client.api.GssApiRequest


    public void testSaslGssApiBind() throws Exception
    {
        Dn userDn = new Dn( "uid=hnelson,ou=users,dc=example,dc=com" );
        LdapNetworkConnection connection = new LdapNetworkConnection( "localhost", getLdapServer().getPort() );

        GssApiRequest request = new GssApiRequest();
        request.setUsername( userDn.getRdn().getUpValue().getString() );
        request.setCredentials( "secret" );
        request.setRealmName( ldapServer.getSaslRealms().get( 0 ).toUpperCase() );
        request.setKdcHost( "localhost" );
        request.setKdcPort( 6088 );
        BindResponse resp = connection.bind( request );
        assertEquals( ResultCodeEnum.SUCCESS, resp.getLdapResult().getResultCode() );

        Entry entry = connection.lookup( userDn );
        assertEquals( "hnelson", entry.get( "uid" ).getString() );
View Full Code Here


    public void testSaslGssApiBindBadRealm() throws Exception
    {
        Dn userDn = new Dn( "uid=hnelson,ou=users,dc=example,dc=com" );
        LdapNetworkConnection connection = new LdapNetworkConnection( "localhost", ldapServer.getPort() );

        GssApiRequest request = new GssApiRequest();
        request.setUsername( userDn.getRdn().getUpValue().getString() );
        request.setCredentials( "secret" );
        request.setRealmName( "badrealm.com" );
        request.setKdcHost( "localhost" );
        request.setKdcPort( 6088 );
        try
        {
            connection.bind( request );
        }
        catch ( Exception e )
View Full Code Here

    public void testSaslGssApiBindBadPassword() throws Exception
    {
        Dn userDn = new Dn( "uid=hnelson,ou=users,dc=example,dc=com" );
        LdapNetworkConnection connection = new LdapNetworkConnection( "localhost", ldapServer.getPort() );

        GssApiRequest request = new GssApiRequest();
        request.setUsername( userDn.getRdn().getUpValue().getString() );
        request.setCredentials( "badsecret" );
        request.setRealmName( ldapServer.getSaslRealms().get( 0 ).toUpperCase() );
        request.setKdcHost( "localhost" );
        request.setKdcPort( 6088 );
        try
        {
            connection.bind( request );
        }
        catch ( Exception e )
View Full Code Here

            assertEquals( "hnelson", entry.get( "uid" ).getString() );
            connection.close();

            // GSSAPI
            connection = new LdapNetworkConnection( "localhost", ldapServer.getPort() );
            GssApiRequest gssApiRequest = new GssApiRequest();
            gssApiRequest.setUsername( userDn.getRdn().getUpValue().getString() );
            gssApiRequest.setCredentials( "secret" );
            gssApiRequest.setRealmName( ldapServer.getSaslRealms().get( 0 ) );
            gssApiRequest.setKdcHost( "localhost" );
            gssApiRequest.setKdcPort( 6088 );
            resp = connection.bind( gssApiRequest );
            assertEquals( ResultCodeEnum.SUCCESS, resp.getLdapResult().getResultCode() );
            entry = connection.lookup( userDn );
            assertEquals( "hnelson", entry.get( "uid" ).getString() );
            connection.close();
View Full Code Here

        Dn userDn = new Dn( "uid=hnelson,ou=users,dc=example,dc=com" );
        LdapNetworkConnection connection = new LdapNetworkConnection( "localhost", getLdapServer().getPort() );

        kdcServer.getConfig().setPaEncTimestampRequired( false );
       
        GssApiRequest request = new GssApiRequest();
        request.setUsername( userDn.getRdn().getValue().getString() );
        request.setCredentials( "secret" );
        request.setRealmName( ldapServer.getSaslRealms().get( 0 ).toUpperCase() );
        request.setKdcHost( "localhost" );
        request.setKdcPort( 6088 );
        BindResponse resp = connection.bind( request );
        assertEquals( ResultCodeEnum.SUCCESS, resp.getLdapResult().getResultCode() );

        Entry entry = connection.lookup( userDn );
        assertEquals( "hnelson", entry.get( "uid" ).getString() );
View Full Code Here

    public void testSaslGssApiBindBadRealm() throws Exception
    {
        Dn userDn = new Dn( "uid=hnelson,ou=users,dc=example,dc=com" );
        LdapNetworkConnection connection = new LdapNetworkConnection( "localhost", ldapServer.getPort() );

        GssApiRequest request = new GssApiRequest();
        request.setUsername( userDn.getRdn().getValue().getString() );
        request.setCredentials( "secret" );
        request.setRealmName( "badrealm.com" );
        request.setKdcHost( "localhost" );
        request.setKdcPort( 6088 );
        try
        {
            connection.bind( request );
        }
        catch ( Exception e )
View Full Code Here

    public void testSaslGssApiBindBadPassword() throws Exception
    {
        Dn userDn = new Dn( "uid=hnelson,ou=users,dc=example,dc=com" );
        LdapNetworkConnection connection = new LdapNetworkConnection( "localhost", ldapServer.getPort() );

        GssApiRequest request = new GssApiRequest();
        request.setUsername( userDn.getRdn().getValue().getString() );
        request.setCredentials( "badsecret" );
        request.setRealmName( ldapServer.getSaslRealms().get( 0 ).toUpperCase() );
        request.setKdcHost( "localhost" );
        request.setKdcPort( 6088 );
        try
        {
            connection.bind( request );
        }
        catch ( Exception e )
View Full Code Here

            assertEquals( "hnelson", entry.get( "uid" ).getString() );
            connection.close();

            // GSSAPI
            connection = new LdapNetworkConnection( "localhost", ldapServer.getPort() );
            GssApiRequest gssApiRequest = new GssApiRequest();
            gssApiRequest.setUsername( userDn.getRdn().getValue().getString() );
            gssApiRequest.setCredentials( "secret" );
            gssApiRequest.setRealmName( ldapServer.getSaslRealms().get( 0 ) );
            gssApiRequest.setKdcHost( "localhost" );
            gssApiRequest.setKdcPort( 6088 );
            resp = connection.bind( gssApiRequest );
            assertEquals( ResultCodeEnum.SUCCESS, resp.getLdapResult().getResultCode() );
            entry = connection.lookup( userDn );
            assertEquals( "hnelson", entry.get( "uid" ).getString() );
            connection.close();
View Full Code Here

    public void testSaslGssApiBind() throws Exception
    {
        Dn userDn = new Dn( "uid=hnelson,ou=users,dc=example,dc=com" );
        LdapNetworkConnection connection = new LdapNetworkConnection( "localhost", getLdapServer().getPort() );

        GssApiRequest request = new GssApiRequest();
        request.setUsername( userDn.getRdn().getValue().getString() );
        request.setCredentials( "secret" );
        request.setRealmName( ldapServer.getSaslRealms().get( 0 ).toUpperCase() );
        request.setKdcHost( "localhost" );
        request.setKdcPort( 6088 );
        BindResponse resp = connection.bind( request );
        assertEquals( ResultCodeEnum.SUCCESS, resp.getLdapResult().getResultCode() );

        Entry entry = connection.lookup( userDn );
        assertEquals( "hnelson", entry.get( "uid" ).getString() );
View Full Code Here

    public void testSaslGssApiBindBadRealm() throws Exception
    {
        Dn userDn = new Dn( "uid=hnelson,ou=users,dc=example,dc=com" );
        LdapNetworkConnection connection = new LdapNetworkConnection( "localhost", ldapServer.getPort() );

        GssApiRequest request = new GssApiRequest();
        request.setUsername( userDn.getRdn().getValue().getString() );
        request.setCredentials( "secret" );
        request.setRealmName( "badrealm.com" );
        request.setKdcHost( "localhost" );
        request.setKdcPort( 6088 );
        try
        {
            connection.bind( request );
        }
        catch ( Exception e )
View Full Code Here

TOP

Related Classes of org.apache.directory.ldap.client.api.GssApiRequest

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.