Index: java/org/apache/commons/httpclient/HttpMethodBase.java =================================================================== RCS file: /home/cvspublic/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HttpMethodBase.java,v retrieving revision 1.134 diff -u -r1.134 HttpMethodBase.java --- java/org/apache/commons/httpclient/HttpMethodBase.java 20 Apr 2003 23:26:22 -0000 1.134 +++ java/org/apache/commons/httpclient/HttpMethodBase.java 21 Apr 2003 00:02:06 -0000 @@ -2333,7 +2333,7 @@ buffer.append(port); } buffer.append('#'); - buffer.append(authscheme.getRealm()); + buffer.append(authscheme.getID()); String realm = buffer.toString(); if (realmsUsed.contains(realm)) { Index: java/org/apache/commons/httpclient/auth/AuthScheme.java =================================================================== RCS file: /home/cvspublic/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/auth/AuthScheme.java,v retrieving revision 1.3 diff -u -r1.3 AuthScheme.java --- java/org/apache/commons/httpclient/auth/AuthScheme.java 6 Apr 2003 22:31:53 -0000 1.3 +++ java/org/apache/commons/httpclient/auth/AuthScheme.java 21 Apr 2003 00:02:07 -0000 @@ -119,6 +119,24 @@ String getRealm(); /** + * Returns a String identifying the authentication challenge. This is + * used, in combination with the host and port to determine if + * authorization has already been attempted or not. Schemes which + * require multiple requests to complete the authentication should + * return a different value for each stage in the request. + * + *

Additionally, the ID should take into account any changes to the + * authentication challenge and return a different value when appropriate. + * For example when the realm changes in basic authentication it should be + * considered a different authentication attempt and a different value should + * be returned.

+ * + * @return String a String identifying the authentication challenge. The + * returned value may be null. + */ + String getID(); + + /** * Produces an authorization string for the given set of {@link Credentials}, * method name and URI using the given authentication scheme. * Index: java/org/apache/commons/httpclient/auth/NTLMScheme.java =================================================================== RCS file: /home/cvspublic/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/auth/NTLMScheme.java,v retrieving revision 1.3 diff -u -r1.3 NTLMScheme.java --- java/org/apache/commons/httpclient/auth/NTLMScheme.java 6 Apr 2003 22:31:53 -0000 1.3 +++ java/org/apache/commons/httpclient/auth/NTLMScheme.java 21 Apr 2003 00:02:09 -0000 @@ -134,6 +134,26 @@ return null; } + /** + * Returns a String identifying the authentication challenge. This is + * used, in combination with the host and port to determine if + * authorization has already been attempted or not. Schemes which + * require multiple requests to complete the authentication should + * return a different value for each stage in the request. + * + *

Additionally, the ID should take into account any changes to the + * authentication challenge and return a different value when appropriate. + * For example when the realm changes in basic authentication it should be + * considered a different authentication attempt and a different value should + * be returned.

+ * + * @return String a String identifying the authentication challenge. The + * returned value may be null. + */ + public String getID() { + return ntlmchallenge; + } + /** * Returns authentication parameter with the given name, if available. Index: java/org/apache/commons/httpclient/auth/RFC2617Scheme.java =================================================================== RCS file: /home/cvspublic/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/auth/RFC2617Scheme.java,v retrieving revision 1.3 diff -u -r1.3 RFC2617Scheme.java --- java/org/apache/commons/httpclient/auth/RFC2617Scheme.java 6 Apr 2003 22:31:53 -0000 1.3 +++ java/org/apache/commons/httpclient/auth/RFC2617Scheme.java 21 Apr 2003 00:02:10 -0000 @@ -130,4 +130,26 @@ public String getRealm() { return getParameter("realm"); } + + /** + * Returns a String identifying the authentication challenge. This is + * used, in combination with the host and port to determine if + * authorization has already been attempted or not. Schemes which + * require multiple requests to complete the authentication should + * return a different value for each stage in the request. + * + *

Additionally, the ID should take into account any changes to the + * authentication challenge and return a different value when appropriate. + * For example when the realm changes in basic authentication it should be + * considered a different authentication attempt and a different value should + * be returned.

+ * + *

This method simply returns the realm for the challenge.

+ * + * @return String a String identifying the authentication challenge. The + * returned value may be null. + */ + public String getID() { + return getRealm(); + } }