hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1424443 - in /httpcomponents/httpclient/branches/4.2.x: RELEASE_NOTES.txt httpclient/src/main/java/org/apache/http/impl/auth/GGSSchemeBase.java
Date Thu, 20 Dec 2012 12:56:03 GMT
Author: olegk
Date: Thu Dec 20 12:56:02 2012
New Revision: 1424443

URL: http://svn.apache.org/viewvc?rev=1424443&view=rev
Log:
Kerberos and SPNego auth schemes use incorrect authorization header name when authenticating
with a proxy

Modified:
    httpcomponents/httpclient/branches/4.2.x/RELEASE_NOTES.txt
    httpcomponents/httpclient/branches/4.2.x/httpclient/src/main/java/org/apache/http/impl/auth/GGSSchemeBase.java

Modified: httpcomponents/httpclient/branches/4.2.x/RELEASE_NOTES.txt
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/branches/4.2.x/RELEASE_NOTES.txt?rev=1424443&r1=1424442&r2=1424443&view=diff
==============================================================================
--- httpcomponents/httpclient/branches/4.2.x/RELEASE_NOTES.txt (original)
+++ httpcomponents/httpclient/branches/4.2.x/RELEASE_NOTES.txt Thu Dec 20 12:56:02 2012
@@ -1,6 +1,10 @@
 Changes since 4.2.2
 -------------------
 
+* Kerberos and SPNego auth schemes use incorrect authorization header name when authenticating
+  with a proxy.
+  Contributed by Oleg Kalnichevski <olegk at apache.org>
+
 * [HTTPCLIENT-1283] NTLM needs to use Locale-independent form of
   toUpperCase().
   Contributed by Karl Wright <DaddyWri at gmail.com>  

Modified: httpcomponents/httpclient/branches/4.2.x/httpclient/src/main/java/org/apache/http/impl/auth/GGSSchemeBase.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/branches/4.2.x/httpclient/src/main/java/org/apache/http/impl/auth/GGSSchemeBase.java?rev=1424443&r1=1424442&r2=1424443&view=diff
==============================================================================
--- httpcomponents/httpclient/branches/4.2.x/httpclient/src/main/java/org/apache/http/impl/auth/GGSSchemeBase.java
(original)
+++ httpcomponents/httpclient/branches/4.2.x/httpclient/src/main/java/org/apache/http/impl/auth/GGSSchemeBase.java
Thu Dec 20 12:56:02 2012
@@ -31,12 +31,13 @@ import org.apache.commons.logging.LogFac
 import org.apache.http.Header;
 import org.apache.http.HttpHost;
 import org.apache.http.HttpRequest;
+import org.apache.http.auth.AUTH;
 import org.apache.http.auth.AuthenticationException;
 import org.apache.http.auth.ContextAwareAuthScheme;
 import org.apache.http.auth.Credentials;
 import org.apache.http.auth.InvalidCredentialsException;
 import org.apache.http.auth.MalformedChallengeException;
-import org.apache.http.message.BasicHeader;
+import org.apache.http.message.BufferedHeader;
 import org.apache.http.protocol.ExecutionContext;
 import org.apache.http.protocol.HttpContext;
 import org.apache.http.util.CharArrayBuffer;
@@ -173,7 +174,15 @@ public abstract class GGSSchemeBase exte
             if (log.isDebugEnabled()) {
                 log.debug("Sending response '" + tokenstr + "' back to the auth server");
             }
-            return new BasicHeader("Authorization", "Negotiate " + tokenstr);
+            CharArrayBuffer buffer = new CharArrayBuffer(32);
+            if (isProxy()) {
+                buffer.append(AUTH.PROXY_AUTH_RESP);
+            } else {
+                buffer.append(AUTH.WWW_AUTH_RESP);
+            }
+            buffer.append(": Negotiate ");
+            buffer.append(tokenstr);
+            return new BufferedHeader(buffer);
         default:
             throw new IllegalStateException("Illegal state: " + state);
         }



Mime
View raw message