From: <tr...@do...> - 2013-01-15 10:55:35
|
<p>A new comment has been added to the following issue.</p> <table border="0"> <tr> <td width="90px" valign="top"><b>Title:</b></td> <td>SPARQL update fails against Sesame Endpoint secured with Basic HTTP Authentication</td> </tr> <tr> <td><b>Project:</b></td> <td>Core Library (dotNetRDF.dll)</td> </tr> <tr> <td><b>Created By:</b></td> <td>Rob Vesse</td> </tr> <tr> <td><b>Date:</b></td> <td>2013-01-15 10:54 AM</td> </tr> <tr> <td><b>Comment:</b></td> </tr> <tr> <td colspan="2"><p> Ok, so I have now debugged with Fiddler with PreAuthenticate enabled and I still see the same behaviour so I'm now once again of the opinion that this looks to be a Sesame/Tomcat bug. In the Fiddler output I see the following request made by dotNetRDF:</p> <p> </p> <p style="margin: 0px; font-size: 8.5px; font-family: 'Lucida Console'; "> POST http://localhost:8080/openrdf-sesame/repositories/update-me/statements HTTP/1.1</p> <p style="margin: 0px; font-size: 8.5px; font-family: 'Lucida Console'; "> Accept: */*</p> <p style="margin: 0px; font-size: 8.5px; font-family: 'Lucida Console'; "> Content-Type: application/x-www-form-urlencoded</p> <p style="margin: 0px; font-size: 8.5px; font-family: 'Lucida Console'; "> Host: localhost:8080</p> <p style="margin: 0px; font-size: 8.5px; font-family: 'Lucida Console'; "> Content-Length: 343</p> <p style="margin: 0px; font-size: 8.5px; font-family: 'Lucida Console'; "> Expect: 100-continue</p> <p style="margin: 0px; font-size: 8.5px; font-family: 'Lucida Console'; min-height: 9px; "> </p> <p style="margin: 0px; font-size: 8.5px; font-family: 'Lucida Console'; "> update=PREFIX+rdf%3a+%3chttp%3a%2f%2fwww.w3.org%2f1999%2f02%2f22-rdf-syntax-ns%23%3e%0d%0aPREFIX+rdfs%3a+%3chttp%3a%2f%2fwww.w3.org%2f2000%2f01%2frdf-schema%23%3e%0d%0aPREFIX+xsd%3a+%3chttp%3a%2f%2fwww.w3.org%2f2001%2fXMLSchema%23%3e%0d%0aINSERT+DATA%0d%0a%7b+%3chttp%3a%2f%2fx%2f%3e+%3chttp%3a%2f%2fy%2f%3e+%3chttp%3a%2f%2fz%2f%3e+.+%7d%0d%0a</p> <p> This gets the 401 Unauthorized like so:</p> <p> </p> <p style="margin: 0px; font-size: 8.5px; font-family: 'Lucida Console'; "> HTTP/1.1 401 Unauthorized</p> <p style="margin: 0px; font-size: 8.5px; font-family: 'Lucida Console'; "> Server: Apache-Coyote/1.1</p> <p style="margin: 0px; font-size: 8.5px; font-family: 'Lucida Console'; "> WWW-Authenticate: Basic realm="Sesame server configuration"</p> <p style="margin: 0px; font-size: 8.5px; font-family: 'Lucida Console'; "> Content-Type: text/html;charset=utf-8</p> <p style="margin: 0px; font-size: 8.5px; font-family: 'Lucida Console'; "> Content-Length: 954</p> <p style="margin: 0px; font-size: 8.5px; font-family: 'Lucida Console'; "> Date: Tue, 15 Jan 2013 10:46:06 GMT</p> <p style="margin: 0px; font-size: 8.5px; font-family: 'Lucida Console'; min-height: 9px; "> </p> <p style="margin: 0px; font-size: 8.5px; font-family: 'Lucida Console'; "> <html><head><title>Apache Tomcat/7.0.26 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 401 - </h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u></u></p><p><b>description</b> <u>This request requires HTTP authentication ().</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/7.0.26</h3></body></html></p> <p> So then dotNetRDF resends the request with the Authentication header included:</p> <p> </p> <p style="margin: 0px; font-size: 8.5px; font-family: 'Lucida Console'; "> POST http://localhost:8080/openrdf-sesame/repositories/update-me/statements HTTP/1.1</p> <p style="margin: 0px; font-size: 8.5px; font-family: 'Lucida Console'; "> Accept: */*</p> <p style="margin: 0px; font-size: 8.5px; font-family: 'Lucida Console'; "> Content-Type: application/x-www-form-urlencoded</p> <p style="margin: 0px; font-size: 8.5px; font-family: 'Lucida Console'; "> Authorization: Basic YWRtaW46cGFzc3dvcmQ=</p> <p style="margin: 0px; font-size: 8.5px; font-family: 'Lucida Console'; "> Host: localhost:8080</p> <p style="margin: 0px; font-size: 8.5px; font-family: 'Lucida Console'; "> Content-Length: 343</p> <p style="margin: 0px; font-size: 8.5px; font-family: 'Lucida Console'; "> Expect: 100-continue</p> <p style="margin: 0px; font-size: 8.5px; font-family: 'Lucida Console'; min-height: 9px; "> </p> <p style="margin: 0px; font-size: 8.5px; font-family: 'Lucida Console'; "> update=PREFIX+rdf%3a+%3chttp%3a%2f%2fwww.w3.org%2f1999%2f02%2f22-rdf-syntax-ns%23%3e%0d%0aPREFIX+rdfs%3a+%3chttp%3a%2f%2fwww.w3.org%2f2000%2f01%2frdf-schema%23%3e%0d%0aPREFIX+xsd%3a+%3chttp%3a%2f%2fwww.w3.org%2f2001%2fXMLSchema%23%3e%0d%0aINSERT+DATA%0d%0a%7b+%3chttp%3a%2f%2fx%2f%3e+%3chttp%3a%2f%2fy%2f%3e+%3chttp%3a%2f%2fz%2f%3e+.+%7d%0d%0a</p> <p> But then gets back the 501 from the Sesame server:</p> <p> </p> <p style="margin: 0px; font-size: 8.5px; font-family: 'Lucida Console'; "> HTTP/1.1 501 Not Implemented</p> <p style="margin: 0px; font-size: 8.5px; font-family: 'Lucida Console'; "> Server: Apache-Coyote/1.1</p> <p style="margin: 0px; font-size: 8.5px; font-family: 'Lucida Console'; "> Content-Type: text/html;charset=utf-8</p> <p style="margin: 0px; font-size: 8.5px; font-family: 'Lucida Console'; "> Content-Length: 2216</p> <p style="margin: 0px; font-size: 8.5px; font-family: 'Lucida Console'; "> Date: Tue, 15 Jan 2013 10:46:06 GMT</p> <p style="margin: 0px; font-size: 8.5px; font-family: 'Lucida Console'; "> Connection: close</p> <p style="margin: 0px; font-size: 8.5px; font-family: 'Lucida Console'; min-height: 9px; "> </p> <p style="margin: 0px; font-size: 8.5px; font-family: 'Lucida Console'; "> <html><head><title>Apache Tomcat/7.0.26 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 501 - Method update=PREFIX+rdf%3a+%3chttp%3a%2f%2fwww.w3.org%2f1999%2f02%2f22-rdf-syntax-ns%23%3e%0d%0aPREFIX+rdfs%3a+%3chttp%3a%2f%2fwww.w3.org%2f2000%2f01%2frdf-schema%23%3e%0d%0aPREFIX+xsd%3a+%3chttp%3a%2f%2fwww.w3.org%2f2001%2fXMLSchema%23%3e%0d%0aINSERT+DATA%0d%0a%7b+%3chttp%3a%2f%2fx%2f%3e+%3chttp%3a%2f%2fy%2f%3e+%3chttp%3a%2f%2fz%2f%3e+.+%7d%0d%0aPOST is not is not implemented by this servlet for this URI</h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u>Method update=PREFIX+rdf%3a+%3chttp%3a%2f%2fwww.w3.org%2f1999%2f02%2f22-rdf-syntax-ns%23%3e%0d%0aPREFIX+rdfs%3a+%3chttp%3a%2f%2fwww.w3.org%2f2000%2f01%2frdf-schema%23%3e%0d%0aPREFIX+xsd%3a+%3chttp%3a%2f%2fwww.w3.org%2f2001%2fXMLSchema%23%3e%0d%0aINSERT+DATA%0d%0a%7b+%3chttp%3a%2f%2fx%2f%3e+%3chttp%3a%2f%2fy%2f%3e+%3chttp%3a%2f%2fz%2f%3e+.+%7d%0d%0aPOST is not is not implemented by this servlet for this URI</u></p><p><b>description</b> <u>The server does not support the functionality needed to fulfill this request (Method update=PREFIX+rdf%3a+%3chttp%3a%2f%2fwww.w3.org%2f1999%2f02%2f22-rdf-syntax-ns%23%3e%0d%0aPREFIX+rdfs%3a+%3chttp%3a%2f%2fwww.w3.org%2f2000%2f01%2frdf-schema%23%3e%0d%0aPREFIX+xsd%3a+%3chttp%3a%2f%2fwww.w3.org%2f2001%2fXMLSchema%23%3e%0d%0aINSERT+DATA%0d%0a%7b+%3chttp%3a%2f%2fx%2f%3e+%3chttp%3a%2f%2fy%2f%3e+%3chttp%3a%2f%2fz%2f%3e+.+%7d%0d%0aPOST is not is not implemented by this servlet for this URI).</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/7.0.26</h3></body></html></p> <p> Your analysis is correct that Sesame/Tomcat is misinterpreting the HTTP method on the second request somehow which I suspect is a problem in the servlets that Sesame uses to handle requests not in Tomcat itself.</p> <p> </p> <p> I will continue to look into this and possibly ping the Sesame developers to see what they make of this.</p> <p> </p> <p> By the way adding PreAuthenticate does not make a difference because that only causes .Net to cache the credentials after a successful authentication and send them for subsequent requests, it does not cause it to send the credentials from the very first request - see <a href="http://www.west-wind.com/weblog/posts/2010/Feb/18/NET-WebRequestPreAuthenticate-not-quite-what-it-sounds-like">http://www.west-wind.com/weblog/posts/2010/Feb/18/NET-WebRequestPreAuthenticate-not-quite-what-it-sounds-like</a></p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p></td> </tr> </table> <p> More information on this issue can be found at <a href="http://www.dotnetrdf.org/tracker/Issues/IssueDetail.aspx?id=301" target="_blank">http://www.dotnetrdf.org/tracker/Issues/IssueDetail.aspx?id=301</a></p> <p style="text-align:center;font-size:8pt;padding:5px;"> If you no longer wish to receive notifications, please visit <a href="http://www.dotnetrdf.org/tracker/Account/UserProfile.aspx" target="_blank">your profile</a> and change your notifications options. </p> |