takcy / openid4java

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

Identity xhtml with namespaces are incorrectly parsed during discovery #69

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
There's a problem using CrowdID (pre 1.5) as a provider because the xhtml 
at the identity url contains a xml namespace declaration, which isn't 
supported by the underlying Xerces Dom implementation. The tree comes back 
from the parser without an exception, but it's an odd looking tree from 
which the head element's contents cannot be extracted. 

Anyway, given that namespaces aren't supported by the parser, does it not 
make sense to disable this feature when the parser is created? 

I think the change is to add this:  

parser.setFeature("http://xml.org/sax/features/namespaces", false);  

in CyberNekoDOMHtmlParser.parseDocument before the parse call. I believe 
the same might be required in the Yadis parser also.

Original issue reported on code.google.com by james.m....@googlemail.com on 11 Sep 2008 at 1:18

GoogleCodeExporter commented 8 years ago
Is this html:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>

<head>

    <title>
        Atlassian CrowdID
        -
        My OpenID
    </title>

    <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
    <meta name="author" content="Atlassian"/>

    <meta name="robots" content="all"/>

    <meta name="MSSmartTagsPreventParsing" content="true"/>
    <meta name="description" content=""/>
    <meta name="keywords" content=""/>

    <link rel="shortcut icon" href="/openidserver/favicon.ico">

    <meta name="section" content="home" />
        <meta name="subsection" content="identifier" />

        <link rel="openid.server"
href="http://localhost:8095/openidserver/server.openid" />
        <link rel="openid.delegate" href="http://localhost:8095/openidserver/users/abc">

    <style type="text/css" media="all">
        @import "/openidserver/style/main.css";
        @import "/openidserver/style/forms.css";
    </style>

</head>

<body onload="">

<ul id="top">
    <li id="skipNav">
        <a href="#menu">Skip to navigation</a>

    </li>
    <li>
        <a href="#content">Skip to content</a>
    </li>
</ul>

<div id="nonFooter">

        <div id="header">
            <div id="logo">

                <a href="/openidserver/"><img alt="Atlassian CrowdID"
src="/openidserver/images/crowdid_server.gif" height="36" width="119"/></a>
            </div>

            <ul id="userOptions">

                <li id="help">
                    <a href="http://confluence.atlassian.com/display/CROWD/">
                        Help
                    </a>
                </li>

            </ul>
        </div>
        <!-- END #header -->

        <div id="menu">
            <ul>
                <li  class="on">
                    <a href="/openidserver/">Home</a>
                </li>

            </ul>
        </div> <!-- END #menu -->

        <div id="contentLeft">

                <div id="content">
                    <div class="crowdForm">
                <div class="formTitle">
                    <h2>My OpenID</h2>

                </div>

                <div class="identity-block">
                     
                    <div class="identity-img">
                        <br/>
                    </div>
                    <div class="identity-bar">
                        http://localhost:8095/openidserver/users/abc
                    </div>

                </div>

                <div class="identity-info">
                    Use this URL to log in to websites that support OpenID.

                </div>

                <div class="formFooter wizardFooter">
                     
                </div>
            </div>

                </div>

        </div>

</div> <!-- END #nonFooter -->

<div id="footer">
    <p>
        Powered by <a
href="http://confluence.atlassian.com/display/CROWD">Atlassian CrowdID</a>

        Version: 1.5 (Build:#340 - Sep 04, 2008) 
    </p>
    <ul>
        <li class="first">
            <a href="http://jira.atlassian.com/browse/CWD">Report a bug</a>
        </li>
        <li>
            <a href="http://jira.atlassian.com/browse/CWD">Request a feature</a>

        </li>
        <li>
            <a href="http://www.atlassian.com/about/contact.jsp">Contact Atlassian</a>
        </li>
    </ul>
</div>

</body>
</html>

Original comment by zhoushu...@gmail.com on 11 Sep 2008 at 3:04

GoogleCodeExporter commented 8 years ago
I'm guessing that html is from CrowdID 1.5 as apparently they removed the 
namespace 
as a workaround for this issue. I need to integrated with a previous version so 
this 
doesn't help me so much.

This is what I'm seeing...

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> 

<head> 

...

Original comment by james.m....@googlemail.com on 11 Sep 2008 at 3:32

GoogleCodeExporter commented 8 years ago
Fixed in r511, thanks.

Original comment by zhoushu...@gmail.com on 11 Sep 2008 at 4:50

GoogleCodeExporter commented 8 years ago
Thanks yourself!

Original comment by james.m....@googlemail.com on 11 Sep 2008 at 9:28