Skip to content

Digest Authentication fails with 400  #13

@witchi

Description

@witchi

Attempts to log-in to an Apache web-site with digest authentication enabled fail with error code 400.

Digest: uri mismatch -
</gallery2/main.php%3Fg2_controller=remote.GalleryRemote&g2_form%5Bcmd%5D=no-op>
does not match request-uri
</gallery2/main.php?g2_controller=remote.GalleryRemote&g2_form%5Bcmd%5D=no-op>

the key difference is between main.php%3F and main.php?

problems seems to lie in HTTPClient.DefaultAuthHandler (line 470).

fixing with ...

// fix up uri and nonce

params[uri] = new NVPair("uri",
URI.escape(req.getRequestURI(), URI.escpdQueryChar, false));
// URI.escape(req.getRequestURI(), URI.escpdPathChar, false));

seems to do the trick.

References, http://www.ietf.org/rfc/rfc2617.txt (Section 3.2.2.5)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions