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() );