directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r1071281 - /directory/studio/trunk/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/io/api/DirectoryApiConnectionWrapper.java
Date Wed, 16 Feb 2011 15:18:45 GMT
Author: pamarcelot
Date: Wed Feb 16 15:18:43 2011
New Revision: 1071281

URL: http://svn.apache.org/viewvc?rev=1071281&view=rev
Log:
Fix for DIRAPI-42 (Add additional classes and clean method arguments for SASL binds (CRAM-MD5,
DIGEST-MD5, GSS-API)).

Modified:
    directory/studio/trunk/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/io/api/DirectoryApiConnectionWrapper.java

Modified: directory/studio/trunk/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/io/api/DirectoryApiConnectionWrapper.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/io/api/DirectoryApiConnectionWrapper.java?rev=1071281&r1=1071280&r2=1071281&view=diff
==============================================================================
--- directory/studio/trunk/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/io/api/DirectoryApiConnectionWrapper.java
(original)
+++ directory/studio/trunk/plugins/connection.core/src/main/java/org/apache/directory/studio/connection/core/io/api/DirectoryApiConnectionWrapper.java
Wed Feb 16 15:18:43 2011
@@ -36,6 +36,9 @@ import javax.net.ssl.TrustManager;
 import javax.net.ssl.TrustManagerFactory;
 import javax.net.ssl.X509TrustManager;
 
+import org.apache.directory.ldap.client.api.CramMd5Request;
+import org.apache.directory.ldap.client.api.DigestMd5Request;
+import org.apache.directory.ldap.client.api.GssApiRequest;
 import org.apache.directory.ldap.client.api.LdapConnectionConfig;
 import org.apache.directory.ldap.client.api.LdapNetworkConnection;
 import org.apache.directory.ldap.client.api.exception.InvalidConnectionException;
@@ -314,21 +317,33 @@ public class DirectoryApiConnectionWrapp
                         // CRAM-MD5 Authentication
                         else if ( connection.getConnectionParameter().getAuthMethod() ==
ConnectionParameter.AuthenticationMethod.SASL_CRAM_MD5 )
                         {
-                            bindResponse = ldapConnection.bindCramMd5( bindPrincipal, bindPassword,
null );
+                            CramMd5Request cramMd5Request = new CramMd5Request();
+                            cramMd5Request.setUsername( bindPrincipal );
+                            cramMd5Request.setCredentials( bindPassword );
+
+                            bindResponse = ldapConnection.bind( cramMd5Request );
                         }
                         // DIGEST-MD5 Authentication
                         else if ( connection.getConnectionParameter().getAuthMethod() ==
ConnectionParameter.AuthenticationMethod.SASL_DIGEST_MD5 )
                         {
-                            bindResponse = ldapConnection.bindDigestMd5( bindPrincipal, bindPassword,
null,
-                                connection.getConnectionParameter().getSaslRealm() );
+                            DigestMd5Request digestMd5Request = new DigestMd5Request();
+                            digestMd5Request.setUsername( bindPrincipal );
+                            digestMd5Request.setCredentials( bindPassword );
+                            digestMd5Request.setRealmName( connection.getConnectionParameter().getSaslRealm()
);
+
+                            bindResponse = ldapConnection.bind( digestMd5Request );
                         }
                         // GSSAPI Authentication
                         else if ( connection.getConnectionParameter().getAuthMethod() ==
ConnectionParameter.AuthenticationMethod.SASL_GSSAPI )
                         {
-                            bindResponse = ldapConnection.bindGssApi( bindPrincipal, bindPassword,
-                                connection.getConnectionParameter().getKrb5Realm(),
-                                connection.getConnectionParameter().getKrb5KdcHost(),
-                                connection.getConnectionParameter().getKrb5KdcPort() );
+                            GssApiRequest gssApiRequest = new GssApiRequest();
+                            gssApiRequest.setUsername( bindPrincipal );
+                            gssApiRequest.setCredentials( bindPassword );
+                            gssApiRequest.setRealmName( connection.getConnectionParameter().getKrb5Realm()
);
+                            gssApiRequest.setKdcHost( connection.getConnectionParameter().getKrb5KdcHost()
);
+                            gssApiRequest.setKdcPort( connection.getConnectionParameter().getKrb5KdcPort()
);
+
+                            bindResponse = ldapConnection.bind( gssApiRequest );
                         }
 
                         checkResponse( bindResponse );



Mime
View raw message