jbufu / openid4java

Automatically exported from code.google.com/p/openid4java
Apache License 2.0
98 stars 58 forks source link

Yahoo discovery is failing #183

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Do discovery on http://www.yahoo.com
2.
3.

What is the expected output? What do you see instead?

We should get an endpoint (via the X-XRDS-Location header).
X-XRDS-Location header is not returned.

Please use labels and text to provide additional information.

It appears as if, if we pass a User-Agent value in the discovery GET request, 
then we get back the X-XRDS-Location header:

svn diff
Index: src/org/openid4java/discovery/yadis/YadisResolver.java
===================================================================
--- src/org/openid4java/discovery/yadis/YadisResolver.java      (revision 677)
+++ src/org/openid4java/discovery/yadis/YadisResolver.java      (working copy)
@@ -395,7 +395,10 @@
                         requestOptions.addRequestHeader("Accept", YADIS_ACCEPT_HEADER);
                     else
                         requestOptions.addRequestHeader("Accept", YADIS_CONTENT_TYPE);
+
+                    requestOptions.addRequestHeader("User-Agent", 
"openid4java");
                 }
+

                 HttpResponse resp = useGet ?
                     _httpFetcher.get(url.getUrl().toString(), requestOptions) :

Original issue reported on code.google.com by chandrik...@gmail.com on 13 Sep 2012 at 6:30

GoogleCodeExporter commented 9 years ago
Question is: Should I checkin this change ?

Original comment by chandrik...@gmail.com on 13 Sep 2012 at 6:30

GoogleCodeExporter commented 9 years ago
What's the cause of the problem? Has the issue been confirmed? 

Seems to work for me (without a user-agent header):

curl -i -H "User-Agent:"  https://me.yahoo.com/

HTTP/1.1 200 OK
Date: Thu, 13 Sep 2012 18:44:49 GMT
P3P: policyref="http://info.yahoo.com/w3c/p3p.xml", CP="CAO DSP COR CUR ADM DEV 
TAI PSA PSD IVAi IVDi CONi TELo OTPi OUR DELi SAMi OTRi UNRi PUBi IND PHY ONL 
UNI PUR FIN COM NAV INT DEM CNT STA POL HEA PRE LOC GOV"
X-XRDS-Location: https://open.login.yahooapis.com/openid20/www.yahoo.com/xrds
Vary: Accept-Encoding
Connection: close
Transfer-Encoding: chunked
Content-Type: text/html; charset=utf-8
Cache-Control: private

Original comment by Johnny.B...@gmail.com on 13 Sep 2012 at 6:45

GoogleCodeExporter commented 9 years ago
So, looks like if I use http://www.yahoo.com/ to do the discovery & don't pass 
User-Agent it doesn't work. But, with https://me.yahoo.com it does seem to 
work. So, I wont check in the changes.

Original comment by chandrik...@gmail.com on 13 Sep 2012 at 7:37

GoogleCodeExporter commented 9 years ago
I don't think www.yahoo.com is a valid openid identifier for yahoo, have they 
advertised it somewhere? Doesn't work for me even with the user agent sent as 
you said it worked for you:

curl -i -H "User-Agent: openid4java" http://www.yahoo.com/ | grep -i xrds
<nothing>

Original comment by Johnny.B...@gmail.com on 13 Sep 2012 at 9:48

GoogleCodeExporter commented 9 years ago

Original comment by Johnny.B...@gmail.com on 30 Oct 2012 at 10:07