greenbays / openid4java

Automatically exported from code.google.com/p/openid4java
0 stars 0 forks source link

NPE at UrlIdentifier.normalize(UrlIdentifier.java:75) #11

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

1.) Deploy an RP and an OP using OpenId4java.
2.) Create a regular html webpage at the OP root, with HTML rel links
pointing to the Yadis service document.

<meta http-equiv="X-XRDS-Location"
content="http://localhost:8080/yadis/yadis.xml" />
<meta http-equiv="X-YADIS-Location"
content="http://localhost:8080/yadis/yadis.xml" />

2. Attempt to do OpenId discovery by entering http://localhost:8080 into
the OpenId login box on the RP.

3. Internally, this will prompt the ConsumerManager to peform OpenId discovery.

4.) ConsumerManager (and underlying java code) will do an HTTP HEAD on the
user supplied URL.  This will fail, so a GET will be tried.  This will
return the HTML pointers to the XRDS.  

5.) net.openid.discover.Discovery, line 156 will attempt to get a
YadisResult via the YadisResolver.

6.) In YadisResolver line 287, the XRDSLocation is *not* null, so the
normalized URL never gets set (it stays null -- **this appears to be the
bug**).  

7.) Everything else about the YadisResult seems to populate ok.  The
extractDiscoveryInformation() function is called with the YadisResult's
normalizedURL as an arguement (net.openid.discovery.Discovey, Line 207). 
However, since the normalizedURL arg is null, a NullPointerException is
thrown as follows:

Caused by: java.lang.NullPointerException
    at java.net.URI$Parser.parse(URI.java:3010)
    at java.net.URI.<init>(URI.java:578)
    at net.openid.discovery.UrlIdentifier.normalize(UrlIdentifier.java:75)
    at net.openid.discovery.UrlIdentifier.<init>(UrlIdentifier.java:40)

Original issue reported on code.google.com by sappenin on 6 Feb 2007 at 4:23

GoogleCodeExporter commented 8 years ago
Good to see that someone is giving this code a full test-drive :)

This is fixed now in rev 82 -- please have a look and let us know how it works 
for 
you.

Thanks,
Johnny

Original comment by Johnny.B...@gmail.com on 6 Feb 2007 at 6:46

GoogleCodeExporter commented 8 years ago
There appears to be some garbage in the rev 82 version of YadisResolver at line 
290.
 Not sure what that is.

Original comment by sappenin on 6 Feb 2007 at 9:59

GoogleCodeExporter commented 8 years ago
Not sure what you mean - I did left a comment / todo item on that line, which I 
haven't totally sorted out now, but I don't think it's mission critical (and 
not 
well defined in the yadis spec). (Specifically, if the X-XRDS-Location URL that 
was 
discovered is redirected, which value should be included in the YadisResult - 
before 
/ after following redirects).

Original comment by Johnny.B...@gmail.com on 6 Feb 2007 at 11:30

GoogleCodeExporter commented 8 years ago
My bad....when I downloaded from SVN, there was a bunch of garbage that caused a
compile error.  However, I just looked at the latest file in SVN, and it looks 
ok. 
Sorry for the false alarm.

Original comment by sappenin on 7 Feb 2007 at 12:02