hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeffrey Porter" <PORTE...@WMGMAIL.wmg.warwick.ac.uk>
Subject RE: Complex redirect
Date Mon, 06 Mar 2006 13:13:40 GMT


Hi Roland,

Sorry for not asking a specific enough question. I'll try again.
:-)
I've read all the links you sent already, but I'm still in need of
guidance.


The problem I'm having is that the credentials I set for accessing the
following URL don't seem to be accepted. I say this because when I read
from the response body, it still contains the initial login page
(authget.getResponseBody()). Even though the log file seems to show it
loging in & following redirects to the final page.

Below is an extract from the log file showing the redirects the login
goes through...

Does anyone have any ideas on what I should try?

[DEBUG] DefaultHttpParams - -Set parameter http.protocol.cookie-policy =
compatibility
[DEBUG] DefaultHttpParams - -Set parameter
http.authentication.preemptive = true
[DEBUG] HttpMethodDirector - -Preemptively sending default basic
credentials
[DEBUG] HttpMethodDirector - -Authenticating with BASIC <any
realm>@q1.xxxx.com:443
[WARN] HttpMethodDirector - -Required credentials not available for
BASIC <any realm>@q1.xxxx.com:443
[WARN] HttpMethodDirector - -Preemptive authentication requested but no
default credentials available
[DEBUG] HttpConnection - -Open connection to q1.xxxx.com:443
[DEBUG] HttpMethodBase - -Adding Host request header
[DEBUG] HttpMethodDirector - -Redirect required
[DEBUG] HttpMethodDirector - -Redirect requested to location
'https://us.sso.coxxxxnt.com/jsp/preLogin.jsp?partner=fsn&url=https://we
b.cmmseddl.xxxx.com/eddl/logon.jsp&transaction=81176101&ip=137.205.177.1
98'
[DEBUG] HttpMethodDirector - -Redirecting from
'https://q1.xxxx.com:443/mdso/redirect.cgi' to
'https://us.sso.coxxxxnt.com/jsp/preLogin.jsp
[DEBUG] HttpMethodDirector - -Execute redirect 1 of 100
[DEBUG] HttpMethodBase - -Resorting to protocol version default close
connection policy
[DEBUG] HttpMethodBase - -Should NOT close connection, using HTTP/1.1
[DEBUG] HttpConnection - -Connection is locked.  Call to
releaseConnection() ignored.
[DEBUG] HttpConnection - -Releasing connection back to connection
manager.
[DEBUG] HttpMethodDirector - -Preemptively sending default basic
credentials
[DEBUG] HttpMethodDirector - -Authenticating with BASIC <any
realm>@us.sso.coxxxxnt.com:443
[DEBUG] HttpMethodParams - -Credential charset not configured, using
HTTP element charset
[DEBUG] HttpConnection - -Open connection to us.sso.coxxxxnt.com:443
[DEBUG] HttpMethodBase - -Adding Host request header
[DEBUG] HttpMethodBase - -Cookie accepted: "JSESSIONID=aSwJQBTrJ2u9"
[DEBUG] HttpMethodDirector - -Redirect required
[DEBUG] HttpMethodDirector - -Redirect requested to location
'https://us.sso.coxxxxnt.com/mdso/fsn/secured?cmd=PITCHER'
[DEBUG] HttpMethodDirector - -Redirecting from
'https://us.sso.coxxxxnt.com:443/jsp/preLogin.jsp' to
'https://us.sso.coxxxxnt.com/mdso/fsn/secured
[DEBUG] HttpMethodDirector - -Execute redirect 2 of 100
[DEBUG] HttpMethodBase - -Resorting to protocol version default close
connection policy
[DEBUG] HttpMethodBase - -Should NOT close connection, using HTTP/1.1
[DEBUG] HttpConnection - -Connection is locked.  Call to
releaseConnection() ignored.
[DEBUG] HttpMethodBase - -Adding Host request header
[DEBUG] HttpMethodDirector - -Redirect required
[DEBUG] HttpMethodDirector - -Redirect requested to location
'https://us.sso.coxxxxnt.com/jsp/preLogin.jsp?CT_ORIG_URL=%2Fmdso%2Ffsn%
2Fsecured%3Fcmd%3DPITCHER&ct_orig_uri=%2Fmdso%2Ffsn%2Fsecured%3Fcmd%3DPI
TCHER'
[DEBUG] HttpMethodDirector - -Redirecting from
'https://us.sso.coxxxxnt.com:443/mdso/fsn/secured' to
'https://us.sso.coxxxxnt.com/jsp/preLogin.jsp
[DEBUG] HttpMethodDirector - -Execute redirect 3 of 100
[DEBUG] HttpMethodBase - -Resorting to protocol version default close
connection policy
[DEBUG] HttpMethodBase - -Should NOT close connection, using HTTP/1.1
[DEBUG] HttpConnection - -Connection is locked.  Call to
releaseConnection() ignored.
[DEBUG] HttpMethodBase - -Adding Host request header
[DEBUG] HttpConnection - -Input data availableLogin2 form get: HTTP/1.1
200 OK
[WARN] HttpMethodBase - -Going to buffer response body of large or
unknown size. Using getResponseBodyAsStream instead is recommended.
[DEBUG] HttpMethodBase - -Buffering response body
[DEBUG] HttpMethodBase - -Resorting to protocol version default close
connection policy
[DEBUG] HttpMethodBase - -Should NOT close connection, using HTTP/1.1
[DEBUG] HttpConnection - -Releasing connection back to connection
manager.


Thanks
Jeff
















-----Original Message-----
From: Roland Weber [mailto:http-async@dubioso.net] 
Sent: 03 March 2006 20:58
To: HttpClient User Discussion
Subject: Re: Complex redirect

Hi Jeff,

if you want us to help, then you have to ask *precise* questions.
http://jakarta.apache.org/site/mail.html
http://www.catb.org/~esr/faqs/smart-questions.html

> In code I can replicate the steps 1 & 2.
>
> And now I'm stuck.

What does that mean? Do you get an error response from the server?
Do you get an exception in your Java code? You've got a link, you
know how to send a GetMethod, what happens if you do?

> 3:
>
> I then click on a link to...
>
> https://q1.site2.com/redirect.cgi?back=https://web.site3.com/logon.jsp

Those are https links. You probably have not yet set up SSL,
which is required to access https links. It's all in the manual...
http://jakarta.apache.org/commons/httpclient/sslguide.html

cheers,
  Roland


Jeffrey Porter wrote:
>  
> 
> I'm hoping someone can help me out here. 
> 
> Any advice would be great.
> 
>  
> 
> I'd like to write some code to get to a web page. Easy? You'd think.
:-)
> 
>  
> 
> The actions I take in IE are...
> 
>  
> 
> 1: Go to  www.site1.com <http://www.site1.com/> 
> 
>  
> 
> 2:
> 
> This displays a login page.
> 
> Login with
> 
> User: user1
> 
> Password: jones
> 
>  
> 
> 3:
> 
> I then click on a link to...
> 
> https://q1.site2.com/redirect.cgi?back=https://web.site3.com/logon.jsp
> 
>  
> 
> 4:
> 
> This will then display the login page for site3.
> 
> Login in with
> 
> User:  cdx123
> 
> Password:  qwerty
> 
>  
> 
> In code I can replicate the steps 1 & 2. 
> 
> And now I'm stuck.
> 
>  
> 
> In IE I can't go to Site3 directly, if I do then get sent to the link
> above for site2.
> 
>  
> 
> In IE I can log into the Site2 link, although I have to enter user1
> login twice. But I'll then be displayed the Site3 page I want.
> 
>  
> 
> Its all rather complex.
> 
>  
> 
> Anyone got any tips on what I should do?
> 
> Thanks
> 
> Jeff


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org


Mime
View raw message