hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: RE: I'm a big loser
Date Sat, 24 Jan 2004 10:42:12 GMT
Dave,

Realm is a set of documents/URLs protected by the same authentication
scheme and backed by the same user registry. You may leave the realm
parameter null if you do not know what your authentication realm name
is. Null realm basically means any realm. In very security caution
applications you should probably avoid sending your credentials to any
realm, but if you trust the target host, realm does not really matter
too much, if you do not have to authenticate against multiple realms

I am afraid I can't be of any further help, unless I get to see the
wirelog on the HTTP session in question. Feel free to strip or obfuscate
all the information you deem sensitive: host names, username, passwords,
upload file content, etc. I am only interested in request/response
headers

Oleg


On Fri, 2004-01-23 at 23:11, D Alvarado wrote:
> I'm pretty sure the authentication is basic.  It
> is done through the Apache .htaccess and
> .htpasswd files.  However, I don't have a value
> for "realm" and I'm wondering if I need to put a
> value there.  I'm not even sure what a realm is,
> to be honest with you.
> 
> Thanks for your help - Dave
> 
> ---- Begin Original Message ----
> 
> From: "Kalnichevski, Oleg"
> <oleg.kalnichevski@bearingpoint.com>
> Sent: Fri, 23 Jan 2004 09:01:16 -0000
> To: "Commons HttpClient Project"
> <commons-httpclient-dev@jakarta.apache.org>
> Subject: RE: I'm a big loser
> 
> 
> Dave,
> 
> What kind of authentication does the target
> server expect: basic|digest|NTLM or form-based?
> At the moment it is not quite clear what is going
> on on the server side. If you posted a wire log
> of the HTTP session that exhibits the problem, I
> believe I would be able to tell more. See
> HttpClient logging guide for details
> <http://jakarta.apache.org/commons/httpclient/logging.html>
> 
> Oleg
> 
> 
> -----Original Message-----
>  From: D Alvarado [mailto:laredotornado@wildmail.com]
> Sent: Thursday, January 22, 2004 23:26
> To: commons-httpclient-dev@jakarta.apache.org
> Subject: I'm a big loser
> 
> 
> I can't seem to figure out how to POST data to a
> page that is protected (puts up a gray box where
> you enter the username/password).  The code below
> is in a servlet running on www.mydomain.com and
> submitting to another page also on www.mydomain.com.
> 
>         // Create an instance of HttpClient.
>         HttpClient client = new HttpClient();
>         // submit username/password for the gray box.
>        
> client.getState().setAuthenticationPreemptive(true);
>         UsernamePasswordCredentials creds = new
> UsernamePasswordCredentials("username", "password");
>         client.getState().setCredentials(null,
> request.getServerName(), creds);
> 
>         // Now submit this file to the piece that
> uploads batch files.
>         String targetURL = "http://" +
> request.getServerName() +
> "/hrw/ecom/HRWImportCOPSData";
>         MultipartPostMethod method = new
> MultipartPostMethod(targetURL);
>         method.addParameter("import_file",
> completeEcomFile.getName(), completeEcomFile);
>         method.setDoAuthentication(true);
> 
> but when I try to submit the request using
> 
> statusCode = client.executeMethod(method);
> 
> I repeatedly get the exception "Connection
> refused."  I'm pretty sure the authentication is
> being required by the Apache webserver.  Any help
> is greatly appreciated - Dave
> 
> 
> Care2 make the world greener!
> Eighty-six nations have signed the international
> Framework Convention on Tobacco Control. Help get
> the U.S. on the list!
> http://www.care2.com/go/z/10840/1060
> 
> ---------------------------------------------------------------------
> 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
> 
> 
> 
> ---- End Original Message ----
> 
> 
> 
> 
> Care2 make the world greener!
> Eighty-six nations have signed the international Framework Convention on Tobacco Control.
Help get the U.S. on the list! http://www.care2.com/go/z/10840/1060
> 
> ---------------------------------------------------------------------
> 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