List Info

Thread: svn commit: r432707 - in /webservices/xmlrpc/trunk: client/src/main/java/org/apache/xmlrpc/client/Xm




svn commit: r432707 - in /webservices/xmlrpc/trunk: client/src/main/java/org/apache/xmlrpc/c lient/Xm
user name
2006-08-18 20:05:05
Author: jochen
Date: Fri Aug 18 13:05:03 2006
New Revision: 432707

URL: 
http://svn.apache.org/viewvc?rev=432707&view=rev
Log:
Basic authentication didn't work with the commons http
transport,
if user name or password contained non-ASCII characters.

Modified:
   
webservices/xmlrpc/trunk/client/src/main/java/org/apache/xml
rpc/client/XmlRpcCommonsTransport.java
    webservices/xmlrpc/trunk/pom.xml
    webservices/xmlrpc/trunk/src/changes/changes.xml
   
webservices/xmlrpc/trunk/tests/src/test/java/org/apache/xmlr
pc/test/AuthenticationTest.java

Modified:
webservices/xmlrpc/trunk/client/src/main/java/org/apache/xml
rpc/client/XmlRpcCommonsTransport.java
URL: http://svn.apache.org/viewvc/webservices/xmlrpc/trun
k/client/src/main/java/org/apache/xmlrpc/client/XmlRpcCommon
sTransport.java?rev=432707&r1=432706&r2=432707&v
iew=diff
============================================================
==================
---
webservices/xmlrpc/trunk/client/src/main/java/org/apache/xml
rpc/client/XmlRpcCommonsTransport.java (original)
+++
webservices/xmlrpc/trunk/client/src/main/java/org/apache/xml
rpc/client/XmlRpcCommonsTransport.java Fri Aug 18 13:05:03
2006
 -30,8
+30,10 
 import org.apache.commons.httpclient.auth.AuthScope;
 import org.apache.commons.httpclient.methods.PostMethod;
 import org.apache.commons.httpclient.methods.RequestEntity;
+import
org.apache.commons.httpclient.params.HttpMethodParams;
 import org.apache.xmlrpc.XmlRpcException;
 import org.apache.xmlrpc.XmlRpcRequest;
+import org.apache.xmlrpc.common.XmlRpcStreamConfig;
 import org.apache.xmlrpc.common.XmlRpcStreamRequestConfig;
 import org.apache.xmlrpc.util.HttpUtil;
 import org.apache.xmlrpc.util.XmlRpcIOException;
 -99,6
+101,11 
 	protected void setCredentials(XmlRpcHttpClientConfig
pConfig) throws XmlRpcClientException {
 		String userName = pConfig.getBasicUserName();
 		if (userName != null) {
+            String enc = pConfig.getBasicEncoding();
+            if (enc == null) {
+                enc = XmlRpcStreamConfig.UTF8_ENCODING;
+            }
+           
client.getParams().setParameter(HttpMethodParams.CREDENTIAL_
CHARSET, enc);
 			Credentials creds = new
UsernamePasswordCredentials(userName,
pConfig.getBasicPassword());
 			AuthScope scope = new AuthScope(null,
AuthScope.ANY_PORT, null, AuthScope.ANY_SCHEME);
 			client.getState().setCredentials(scope, creds);

Modified: webservices/xmlrpc/trunk/pom.xml
URL: http://svn.apache.org/viewvc/webservices/xmlrpc/trunk/pom.
xml?rev=432707&r1=432706&r2=432707&view=diff
============================================================
==================
--- webservices/xmlrpc/trunk/pom.xml (original)
+++ webservices/xmlrpc/trunk/pom.xml Fri Aug 18 13:05:03
2006
 -223,7
+223,7 
         <dependency>
            
<groupId>commons-httpclient</groupId>
            
<artifactId>commons-httpclient</artifactId>
-            <version>3.0</version>
+            <version>3.0.1</version>
             <type>jar</type>
             <scope>provided</scope>
         </dependency>

Modified: webservices/xmlrpc/trunk/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/webservices/x
mlrpc/trunk/src/changes/changes.xml?rev=432707&r1=432706
&r2=432707&view=diff
============================================================
==================
--- webservices/xmlrpc/trunk/src/changes/changes.xml
(original)
+++ webservices/xmlrpc/trunk/src/changes/changes.xml Fri Aug
18 13:05:03 2006
 -27,11
+27,14 
 		Basic authentication didn't work, if the base64 encoded
string with
 		user name and password contained more than 72 characters.
       </action>
-      <action dev="jochen"
type="fix" due-to="Landon Fuller"
-          due-to-email="landonfthreerings.net">
+      <action dev="jochen"
type="fix">
         Basic authentication didn't work with the commons
http transport,
         because the commons httpclient wasn't configured
to send credentials
         by default. (It was waiting for a challenge.)
+      </action>
+      <action dev="jochen"
type="fix" issue="XMLRPC-105">
+        Basic authentication didn't work with the commons
http transport,
+        if user name or password contained non-ASCII
characters.
       </action>
     </release>
     <release version="3.0rc1"
date="27-Jul-2006">

Modified:
webservices/xmlrpc/trunk/tests/src/test/java/org/apache/xmlr
pc/test/AuthenticationTest.java
URL: http://svn.apache.org/viewvc/webservices/xmlrpc/trunk/tests
/src/test/java/org/apache/xmlrpc/test/AuthenticationTest.jav
a?rev=432707&r1=432706&r2=432707&view=diff
============================================================
==================
---
webservices/xmlrpc/trunk/tests/src/test/java/org/apache/xmlr
pc/test/AuthenticationTest.java (original)
+++
webservices/xmlrpc/trunk/tests/src/test/java/org/apache/xmlr
pc/test/AuthenticationTest.java Fri Aug 18 13:05:03 2006
 -34,8
+34,8 
  */
 public class AuthenticationTest extends XmlRpcTestCase {
     private static final String PASSWORD =
"98765432109876543210987654321098765432109876543210&q
uot;;
-    private static final String USER_NAME =
"01234567890123456789012345678901234567890123456789&q
uot;;
-//        +
"\u00C4\u00D6\u00DC\u00F6\u00FC\u00E4\u00DF&qu
ot;;
+    private static final String USER_NAME =
"01234567890123456789012345678901234567890123456789&q
uot;
+        +
"\u00C4\u00D6\u00DC\u00F6\u00FC\u00E4\u00DF&qu
ot;;
 
     /** An interface, which is being implemented by the
      * server.


[1]

about | contact  Other archives ( Real Estate discussion Medical topics )