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 3
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:
- Support for HTTP basic and digest authentication (as explained in RFC 2617).
- Credential can be specified either in pj_http_req_param or embedded in the URL (i.e. using "http://user:passwd@server" format).
- the module will remove the username and password part transmitting the URL to server
- Add other authentication settings in pj_http_req_param
- 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.
- 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
Limitations:
- Only one credential may be specified at the moment.
- If WWW-Authenticate or Proxy-Authenticate header contains mode than one header fields, only the first one will be parsed (and subsequently, responded)
Change History (3)
comment:1 Changed 14 years ago by bennylp
- Description modified (diff)
comment:2 Changed 14 years ago by bennylp
- Description modified (diff)
comment:3 Changed 14 years ago by bennylp
- Description modified (diff)
Note: See
TracTickets for help on using
tickets.