Re: Twisted web client digest authentication?

Paul de Vries <[email protected]>
Newsgroups gmane.comp.python.twisted.web
Message-ID <[email protected]>
Thanks for setting me on the right track.  This is the first and (so far) only response I got
so I supposed it was a stupid or impossible question.  
Which is very likely because I'm new to python and twisted.

Paul

Op 5 dec 2011, om 14:51 heeft [email protected] het volgende geschreven:

> 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()
>> _______________________________________________
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.