commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rpor...@saguaro.ro
Subject RE: [HttpClient] How to use HttpClient with Form-based Authentication?
Date Wed, 08 Sep 2004 12:41:35 GMT
un·be·liev·a·ble 

" You should be posting the logon request to /j_security_check, not 
/logintest/"
I posted to "/logintest/j_security_check" and it worked!!!

Thanks Oleg for your help, I owe you one.



                PostMethod authpost = new PostMethod(
"/logintest/j_security_check");
                // Prepare login parameters
                NameValuePair action   = new NameValuePair("action", 
"j_security_check");
                NameValuePair url      = new NameValuePair("url", 
"LoginForm.html");
                NameValuePair userid   = new NameValuePair("j_username", 
"admin");
                NameValuePair password = new NameValuePair("j_password", 
"admin");
                authpost.setRequestBody( 
                  new NameValuePair[] {action, url, userid, password});


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message