-
Notifications
You must be signed in to change notification settings - Fork 653
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Digest authentication thowing errors in Jena 4.3.X and newer #1318
Comments
So the HTTP Authentication Challenge is coming back from whatever SPARQL server you are interacting with which you haven't specified. I'm unclear whether the individual parameter fields within the Following the grammar an
The upshot of which is servers MUST NOT be producing whitespace here BUT recipients i.e. Jena, should strip and ignore such bad whitespace. Although that seems to be between parameters not within the parameters itself, the relevant grammar rule actually looks to be
Which boils down to new lines not being valid in these parameters AFAICT. So this looks like probably a server bug but maybe an area where Jena could be more forgiving? |
The problem is in the outgoing credentials request after the 401 challenge. It is the SPARQL string not being encoded and it has a newline in it; the JDK rejects the request locally. The server has only sent the 401 challenge which is legal and isn't involved in the exception cause at The "uri" auth param in a digest is the "request-target". That includes the query string by my reading of RFC7616->RFC7230 section 5.5 But that does not make sense in our situation
So for the SPARQL case, a request-target of the URI path make sense to me (no query). This work with Jetty. This is not surprising because the Jetty resource is named by the URI without query string. Putting in the encoded query also works with Jetty |
Extra oddity: as query strings for SPARQL can be long, there is a chance the HTTP request will exceed the server limit on request headers - the URI will be in the headers twice (request line and "Authentication" header). The total limit is often 8K but some nginx is 4K. |
FYI - The server I am executing this against is Virtuoso. |
GH-1318: Calculate proper request-target for digest auth use.
is throwing an error:
changing
and it works.
My environment is:
Perhaps SPARQL string isn't being uuencoded properly?
The text was updated successfully, but these errors were encountered: