hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <o.kalnichev...@dplanet.ch>
Subject Re: [PATCH] Authentication Realm & Proxy Authentication Realm
Date Mon, 12 May 2003 19:36:27 GMT
Patch applied

Oleg

On Mon, 2003-05-12 at 20:53, Michael Becke wrote:
> Fine with me.
> 
> Mike
> 
> Oleg Kalnichevski wrote:
> > Here it is
> > 
> > Oleg
> > 
> > On Mon, 2003-05-12 at 20:37, Michael Becke wrote:
> > 
> >>I can't seem to locate the patch.  Could you send it again?
> >>
> >>Mike
> >>
> >>Oleg Kalnichevski wrote:
> >>
> >>>Are there any objections to committing this patch?
> >>>
> >>>Oleg
> >>>
> >>>On Sat, 2003-05-10 at 23:31, Adrian Sutton wrote:
> >>>
> >>>
> >>>>Oleg,
> >>>>I wouldn't call that a compromise - I'd call that the ideal solution!

> >>>>:)  We'd still need to grab the authentication header to check if NTLM

> >>>>authentication is being used (so we know whether to ask for a domain
or 
> >>>>not) but that's no hassle since it's just a simple check for the 
> >>>>presence of "ntlm" in the auth challenge.
> >>>>
> >>>>Thanks for looking into it.
> >>>>
> >>>>Regards,
> >>>>
> >>>>Adrian.
> >>>>
> >>>>On Sunday, May 11, 2003, at 12:29  AM, Oleg Kalnichevski wrote:
> >>>>
> >>>>
> >>>>
> >>>>>Adrian,
> >>>>>In the future get*HeaderGroup will be made public. I would not change
> >>>>>HttpAuthenticator.selectAuthScheme() just to work around limitations
of
> >>>>>the existing API. So, how about this for a compromise solution?
> >>>>>
> >>>>>Cheers
> >>>>>
> >>>>>Oleg
> >>>>>
> >>>>
> >>>>
> >>>>---------------------------------------------------------------------
> >>>>To unsubscribe, e-mail: commons-httpclient-dev-unsubscribe@jakarta.apache.org
> >>>>For additional commands, e-mail: commons-httpclient-dev-help@jakarta.apache.org
> >>>>
> >>>
> >>>
> >>>
> >>>---------------------------------------------------------------------
> >>>To unsubscribe, e-mail: commons-httpclient-dev-unsubscribe@jakarta.apache.org
> >>>For additional commands, e-mail: commons-httpclient-dev-help@jakarta.apache.org
> >>>
> >>
> >>
> >>---------------------------------------------------------------------
> >>To unsubscribe, e-mail: commons-httpclient-dev-unsubscribe@jakarta.apache.org
> >>For additional commands, e-mail: commons-httpclient-dev-help@jakarta.apache.org
> >>
> >>
> >>
> >>------------------------------------------------------------------------
> >>
> >>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.145
> >>diff -u -r1.145 HttpMethodBase.java
> >>--- java/org/apache/commons/httpclient/HttpMethodBase.java	8 May 2003 17:33:51
-0000	1.145
> >>+++ java/org/apache/commons/httpclient/HttpMethodBase.java	12 May 2003 18:45:02
-0000
> >>@@ -174,9 +174,15 @@
> >>     /** Realms that we tried to authenticate to */
> >>     private Set realms = null;
> >> 
> >>+    /** Actual authentication realm */
> >>+    private String realm = null;
> >>+
> >>     /** Proxy Realms that we tried to authenticate to */
> >>     private Set proxyRealms = null;
> >> 
> >>+    /** Actual proxy authentication realm */
> >>+    private String proxyRealm = null;
> >>+
> >>     /** My request path. */
> >>     private String path = null;
> >> 
> >>@@ -195,7 +201,7 @@
> >>     /** Whether or not I should automatically follow redirects. */
> >>     private boolean followRedirects = false;
> >> 
> >>-    /** Whether or not I should automatically processs authentication. */
> >>+    /** Whether or not I should automatically process authentication. */
> >>     private boolean doAuthentication = true;
> >> 
> >>     /** Whether or not I should use the HTTP/1.1 protocol. */
> >>@@ -1263,6 +1269,8 @@
> >>         path = null;
> >>         followRedirects = false;
> >>         doAuthentication = true;
> >>+        realm = null;
> >>+        proxyRealm = null;
> >>         queryString = null;
> >>         getRequestHeaderGroup().clear();
> >>         getResponseHeaderGroup().clear();
> >>@@ -2420,11 +2428,13 @@
> >>                         removeRequestHeader(HttpAuthenticator.WWW_AUTH_RESP);
> >>                         authenticated = HttpAuthenticator.authenticate(
> >>                             authscheme, this, conn, state);
> >>+                        this.realm = authscheme.getRealm();
> >>                         break;
> >>                     case HttpStatus.SC_PROXY_AUTHENTICATION_REQUIRED:
> >>                         removeRequestHeader(HttpAuthenticator.PROXY_AUTH_RESP);
> >>                         authenticated = HttpAuthenticator.authenticateProxy(
> >>                             authscheme, this, conn, state);
> >>+                        this.proxyRealm = authscheme.getRealm();
> >>                         break;
> >>                 }
> >>             } catch (AuthenticationException e) {
> >>@@ -2448,6 +2458,26 @@
> >>     }
> >> 
> >>     /**
> >>+     * Returns proxy authentication realm, if it has been used during authentication
process. 
> >>+     * Otherwise returns <tt>null</tt>.
> >>+     * 
> >>+     * @return proxy authentication realm
> >>+     */
> >>+    public String getProxyAuthenticationRealm() {
> >>+        return this.proxyRealm;
> >>+    }
> >>+
> >>+    /**
> >>+     * Returns authentication realm, if it has been used during authentication
process. 
> >>+     * Otherwise returns <tt>null</tt>.
> >>+     * 
> >>+     * @return authentication realm
> >>+     */
> >>+    public String getAuthenticationRealm() {
> >>+        return this.realm;
> >>+    }
> >>+
> >>+    /**
> >>      * Write a request and read the response. Both the write to the server will
> >>      * be retried {@link #maxRetries} times if the operation fails with a
> >>      * HttpRecoverableException. The write will only be attempted if the read
> >>@@ -2677,5 +2707,4 @@
> >>         this.responseBody = null;
> >>         this.responseStream = responseStream;
> >>     }
> >>-
> >> }
> >>
> >>
> >>
> >>------------------------------------------------------------------------
> >>
> >>---------------------------------------------------------------------
> >>To unsubscribe, e-mail: commons-httpclient-dev-unsubscribe@jakarta.apache.org
> >>For additional commands, e-mail: commons-httpclient-dev-help@jakarta.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-httpclient-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-httpclient-dev-help@jakarta.apache.org
> 


Mime
View raw message