Re: Twisted web client digest authentication?

[email protected]
Newsgroups gmane.comp.python.twisted.web
Message-ID <20111205135134.1778.787156431.divmod.xquotient.74@localhost.localdomain>
On 2 Dec, 02:31 pm, [email protected] wrote:
>Hi
>
>Made something that connects to a httpserver and parses the xml stream 
>it sends.
>The webserver it has to connect to uses digest authentication.
>
>How can I implement digest authentication in this?

Digest authentication is performed in the headers of requests and 
responses.  The server sends a challenge, the client computes a response 
proving they know a secret only one user is supposed to know.
>[snip]
>
>def cbResponse(response):

The response object has all of the headers sent from the server.  You 
can inspect them and then compute the appropriate challenge response to 
include in your *next* request.  If you get it right, then the server 
will give you the content instead of sending you a challenge.

Some work has been done on adding higher-level support for this feature 
to Twisted, but it is not yet complete.  You can follow its progress or 
pitch in at <http://twistedmatrix.com/trac/ticket/5148>.

Jean-Paul
>    print 'Response version: ', response.version
>    finished = Deferred()
>    response.deliverBody(ParseReceived(finished))
>    return finished
>
>d.addCallback(cbResponse)
>reactor.run()
>_______________________________________________
>Twisted-web mailing list
>[email protected]
>http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.