Opened 14 years ago

Last modified 14 years ago

#1136 closed enhancement

Add support for basic and digest authentication in the HTTP client (thanks Johan Lantz for the suggestion) — at Version 1

Reported by: bennylp Owned by: bennylp
Priority: normal Milestone: release-1.8.5
Component: pjlib-util Version: trunk
Keywords: Cc:
Backport to 1.x milestone: Backported:

Description (last modified by bennylp)

This ticket adds HTTP basic and digest authentication support to the HTTP client module in PJLIB-UTIL. With this feature, application configures the HTTP request with a credential (basically a username and password pair), and the HTTP client would retry the request with proper authorization once it receives 401 or 407 response from the server.

Specification:

  1. Support for HTTP basic and digest authentication (as explained in RFC 2617).
  2. Credential can be specified either in pj_http_req_param or embedded in the URL (i.e. using "http://user:passwd@server" format).
    • the username and password part would need to be removed from the URL before it is transmitted to server
  3. Add other authentication settings in pj_http_req_param
  4. When authentication is configured, the first 401/407 response will not be reported to the application; only the final response after the request is retried will be reported to the application.
  5. The request retry (the one with Authorization header that is sent after 401/407 response is received) will be done in a new socket.
    • we will always do this even though server keeps the connection open
    • this is because some server would close the connection
    • ideally perhaps we should look at the value of Keep-Alive header returned by the server

Change History (1)

comment:1 Changed 14 years ago by bennylp

  • Description modified (diff)
Note: See TracTickets for help on using tickets.