<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://performiq.com/kb/index.php?action=history&amp;feed=atom&amp;title=ZSI_Stuff</id>
	<title>ZSI Stuff - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://performiq.com/kb/index.php?action=history&amp;feed=atom&amp;title=ZSI_Stuff"/>
	<link rel="alternate" type="text/html" href="https://performiq.com/kb/index.php?title=ZSI_Stuff&amp;action=history"/>
	<updated>2026-05-18T10:03:23Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.37.1</generator>
	<entry>
		<id>https://performiq.com/kb/index.php?title=ZSI_Stuff&amp;diff=695&amp;oldid=prev</id>
		<title>PeterHarding at 00:48, 25 January 2008</title>
		<link rel="alternate" type="text/html" href="https://performiq.com/kb/index.php?title=ZSI_Stuff&amp;diff=695&amp;oldid=prev"/>
		<updated>2008-01-25T00:48:09Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 10:48, 25 January 2008&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l613&quot;&gt;Line 613:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 613:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Back to [[Python]] [[Python - ZSI Module]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Back to [[Python]] [[Python - ZSI Module]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Python]][[Category:SOAP]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>PeterHarding</name></author>
	</entry>
	<entry>
		<id>https://performiq.com/kb/index.php?title=ZSI_Stuff&amp;diff=680&amp;oldid=prev</id>
		<title>PeterHarding at 00:38, 25 January 2008</title>
		<link rel="alternate" type="text/html" href="https://performiq.com/kb/index.php?title=ZSI_Stuff&amp;diff=680&amp;oldid=prev"/>
		<updated>2008-01-25T00:38:58Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 10:38, 25 January 2008&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l611&quot;&gt;Line 611:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 611:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;immediately notify the sender and delete the original.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;immediately notify the sender and delete the original.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Back to [[Python]] [[Python - ZSI Module]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>PeterHarding</name></author>
	</entry>
	<entry>
		<id>https://performiq.com/kb/index.php?title=ZSI_Stuff&amp;diff=679&amp;oldid=prev</id>
		<title>PeterHarding: New page: Back to Python Python - ZSI Module  = Digest Authentication ZSI 1.7 =  &lt;pre&gt; Just for the record. After accepting that pythons build-in digest authentication (HTTPDigestAuthHandler...</title>
		<link rel="alternate" type="text/html" href="https://performiq.com/kb/index.php?title=ZSI_Stuff&amp;diff=679&amp;oldid=prev"/>
		<updated>2008-01-25T00:38:37Z</updated>

		<summary type="html">&lt;p&gt;New page: Back to &lt;a href=&quot;/kb/index.php/Python&quot; title=&quot;Python&quot;&gt;Python&lt;/a&gt; &lt;a href=&quot;/kb/index.php/Python_-_ZSI_Module&quot; title=&quot;Python - ZSI Module&quot;&gt;Python - ZSI Module&lt;/a&gt;  = Digest Authentication ZSI 1.7 =  &amp;lt;pre&amp;gt; Just for the record. After accepting that pythons build-in digest authentication (HTTPDigestAuthHandler...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Back to [[Python]] [[Python - ZSI Module]]&lt;br /&gt;
&lt;br /&gt;
= Digest Authentication ZSI 1.7 =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Just for the record. After accepting that pythons build-in digest&lt;br /&gt;
authentication (HTTPDigestAuthHandler)  does *NOT* work, I made my own&lt;br /&gt;
digest authentication handler and built it into ZSI, they have recieved&lt;br /&gt;
and accepted the patch so it should be part of the next ZSI release&lt;br /&gt;
(current 1.7).&lt;br /&gt;
&lt;br /&gt;
I have tested the implementation with Microsoft MapPoint services,&lt;br /&gt;
seems OK:&lt;br /&gt;
&lt;br /&gt;
#-------------------------------------&lt;br /&gt;
#Usage example (MapPoint SOAP Services):&lt;br /&gt;
#-------------------------------------&lt;br /&gt;
from CommonService_services import *&lt;br /&gt;
loc = FindServiceLocator()&lt;br /&gt;
import sys&lt;br /&gt;
import ZSI&lt;br /&gt;
kw={&amp;#039;tracefile&amp;#039;:sys.stdout, &amp;#039;auth&amp;#039; : (&lt;br /&gt;
ZSI.AUTH.httpdigest, &amp;#039;username&amp;#039;, &amp;#039;passwd&amp;#039;) }&lt;br /&gt;
portType = loc.getFindServiceSoap(**kw)&lt;br /&gt;
&lt;br /&gt;
AddressLine=&amp;#039;Lergravsvej 28&amp;#039;&lt;br /&gt;
PostalCode=&amp;#039;8660&amp;#039;&lt;br /&gt;
CountryRegion=&amp;#039;DK&amp;#039;&lt;br /&gt;
InputAddress = ns1.Address_Def()&lt;br /&gt;
InputAddress._AddressLine = AddressLine&lt;br /&gt;
InputAddress._PostalCode = PostalCode&lt;br /&gt;
InputAddress._CountryRegion = CountryRegion&lt;br /&gt;
&lt;br /&gt;
specification = ns1.FindAddressSpecification_Def()&lt;br /&gt;
specification._InputAddress = InputAddress&lt;br /&gt;
specification._DataSourceName = &amp;#039;MapPoint.EU&amp;#039;&lt;br /&gt;
request = FindAddressSoapInWrapper()&lt;br /&gt;
&lt;br /&gt;
request._specification = specification&lt;br /&gt;
&lt;br /&gt;
res = portType.FindAddress(request)&lt;br /&gt;
#-----------------------------------------&lt;br /&gt;
&lt;br /&gt;
Best regards&lt;br /&gt;
Jakob Simon-Gaarde&lt;br /&gt;
{noformat}&lt;br /&gt;
{noformat}&lt;br /&gt;
Digest MD5 authentication over using ZSI&lt;br /&gt;
trapeze.jsg at gmail.com trapeze.jsg at gmail.com&lt;br /&gt;
Sun Sep 4 01:03:20 CEST 2005&lt;br /&gt;
&lt;br /&gt;
    * Previous message: PyChecker lives, version 0.8.15 released&lt;br /&gt;
    * Next message: Digest MD5 authentication over using ZSI&lt;br /&gt;
    * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]&lt;br /&gt;
&lt;br /&gt;
Hi.&lt;br /&gt;
&lt;br /&gt;
I am trying to get through to Microsoft MapPoint Services using ZSI for&lt;br /&gt;
soap handling. I can generate the service classes and also the&lt;br /&gt;
soap-requests generated by the service classes seem to be OK. The&lt;br /&gt;
problem I am facing is that I can&amp;#039;t seem to authenticate myself. I have&lt;br /&gt;
made a small change to ZSI.client so that when I get a &amp;quot;401&lt;br /&gt;
Unauthorized&amp;quot; response from the remote server I build up a nice&lt;br /&gt;
authorization request:&lt;br /&gt;
&lt;br /&gt;
POST /Find-30/FindService.asmx HTTP/1.1&lt;br /&gt;
Host: findv3.staging.mappoint.net&lt;br /&gt;
Accept-Encoding: identity&lt;br /&gt;
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client&lt;br /&gt;
Protocol 1.1.4322.573)&lt;br /&gt;
SOAPAction: &amp;quot;http://s.mappoint.net/mappoint-30/FindAddress&amp;quot;&lt;br /&gt;
Authorization: Digest username=&amp;quot;106288&amp;quot;, realm=&amp;quot;MapPoint&amp;quot;,&lt;br /&gt;
nonce=&amp;quot;91168da8e3a097f41264875211009a194b99a94ffe5bc619415820880a5b&amp;quot;,&lt;br /&gt;
uri=&amp;quot;/Find-30/FindService.asmx&amp;quot;,&lt;br /&gt;
response=&amp;quot;26aa9e36f9ff2a8308030810ab83dad1&amp;quot;, qop=auth, nc=00000001,&lt;br /&gt;
cnonce=&amp;quot;623c12f33f0eb883&amp;quot;&lt;br /&gt;
Content-length: 0&lt;br /&gt;
Expect: 100-continue&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The problem is that the server won&amp;#039;t authorize me. I have a C# .net&lt;br /&gt;
program that does exactly the same I&amp;#039;m trying in python, and it is&lt;br /&gt;
authorized nicely:&lt;br /&gt;
&lt;br /&gt;
POST /Find-30/FindService.asmx HTTP/1.1&lt;br /&gt;
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client&lt;br /&gt;
Protocol 1.1.4322.573)&lt;br /&gt;
Content-Type: text/xml; charset=utf-8&lt;br /&gt;
SOAPAction: &amp;quot;http://s.mappoint.net/mappoint-30/FindAddress&amp;quot;&lt;br /&gt;
Authorization: Digest&lt;br /&gt;
username=&amp;quot;106288&amp;quot;,realm=&amp;quot;MapPoint&amp;quot;,nonce=&amp;quot;487911f02ed2ef706326675211008a8ec39cfa4fb09304757c8dde417354&amp;quot;,uri=&amp;quot;/Find-30/FindService.asmx&amp;quot;,cnonce=&amp;quot;e1ed9880c5e3777a4ba280cec1c9e362&amp;quot;,nc=00000001,qop=&amp;quot;auth&amp;quot;,response=&amp;quot;b4119a4db73814fd09ae5fec11fc9730&amp;quot;&lt;br /&gt;
Content-Length: 523&lt;br /&gt;
Expect: 100-continue&lt;br /&gt;
Host: findv3.staging.mappoint.net&lt;br /&gt;
&lt;br /&gt;
So I guess the problem is in the Digest calculation. Unfortunately I&lt;br /&gt;
don&amp;#039;t know much about the issue but I have managed to &amp;quot;steel&amp;quot; this from&lt;br /&gt;
urllib2 and changed it a bit to fit my usage (see below).&lt;br /&gt;
&lt;br /&gt;
1. Can I do this another way?&lt;br /&gt;
2. Has anybody made a digest MD5 authenticator for ZSI?&lt;br /&gt;
3. Whats wrong with my calculation or is it the header??&lt;br /&gt;
4. Can I use urllib2 to test the authentication part of a Soap Service.&lt;br /&gt;
&lt;br /&gt;
----------------- My authentication calculator ----&amp;gt;&lt;br /&gt;
&lt;br /&gt;
import md5&lt;br /&gt;
import sha&lt;br /&gt;
import re&lt;br /&gt;
import time&lt;br /&gt;
import random&lt;br /&gt;
import os.path&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
def randombytes(n):&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;Return n random bytes.&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    # Use /dev/urandom if it is available.  Fall back to random module&lt;br /&gt;
    # if not.  It might be worthwhile to extend this function to use&lt;br /&gt;
    # other platform-specific mechanisms for getting random bytes.&lt;br /&gt;
    if os.path.exists(&amp;quot;/dev/urandom&amp;quot;):&lt;br /&gt;
        f = open(&amp;quot;/dev/urandom&amp;quot;)&lt;br /&gt;
        s = f.read(n)&lt;br /&gt;
        f.close()&lt;br /&gt;
        return s&lt;br /&gt;
    else:&lt;br /&gt;
        L = [chr(random.randrange(0, 256)) for i in range(n)]&lt;br /&gt;
        return &amp;quot;&amp;quot;.join(L)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
class Challenge:&lt;br /&gt;
  def __init__(self,challenge):&lt;br /&gt;
    self.params = {}&lt;br /&gt;
    self.no_chal=0&lt;br /&gt;
    if challenge.upper().find(&amp;#039;WWW-Authenticate:&amp;#039;.upper())==-1:&lt;br /&gt;
      self.no_chal=1&lt;br /&gt;
    rx =&lt;br /&gt;
re.compile(&amp;#039;WWW-Authenticate:.*qop=&amp;quot;(\w+)&amp;quot;&amp;#039;,re.IGNORECASE|re.MULTILINE)&lt;br /&gt;
    m = rx.search(challenge)&lt;br /&gt;
    if m:&lt;br /&gt;
      self.params[&amp;#039;qop&amp;#039;] = m.group(1)&lt;br /&gt;
&lt;br /&gt;
    rx =&lt;br /&gt;
re.compile(&amp;#039;WWW-Authenticate:.*realm=&amp;quot;(\w+)&amp;quot;&amp;#039;,re.IGNORECASE|re.MULTILINE)&lt;br /&gt;
    m = rx.search(challenge)&lt;br /&gt;
    if m:&lt;br /&gt;
      self.params[&amp;#039;realm&amp;#039;] = m.group(1)&lt;br /&gt;
&lt;br /&gt;
    rx =&lt;br /&gt;
re.compile(&amp;#039;WWW-Authenticate:.*algorithm=&amp;quot;(\w+)&amp;quot;&amp;#039;,re.IGNORECASE|re.MULTILINE)&lt;br /&gt;
    m = rx.search(challenge)&lt;br /&gt;
    if m:&lt;br /&gt;
      self.params[&amp;#039;algorithm&amp;#039;] = m.group(1)&lt;br /&gt;
&lt;br /&gt;
    rx =&lt;br /&gt;
re.compile(&amp;#039;WWW-Authenticate:.*nonce=&amp;quot;(\w+)&amp;quot;&amp;#039;,re.IGNORECASE|re.MULTILINE)&lt;br /&gt;
    m = rx.search(challenge)&lt;br /&gt;
    if m:&lt;br /&gt;
      self.params[&amp;#039;nonce&amp;#039;] = m.group(1)&lt;br /&gt;
&lt;br /&gt;
    rx =&lt;br /&gt;
re.compile(&amp;#039;WWW-Authenticate:.*opaque=&amp;quot;(\w+)&amp;quot;&amp;#039;,re.IGNORECASE|re.MULTILINE)&lt;br /&gt;
    m = rx.search(challenge)&lt;br /&gt;
    if m:&lt;br /&gt;
      self.params[&amp;#039;opaque&amp;#039;] = m.group(1)&lt;br /&gt;
&lt;br /&gt;
    rx =&lt;br /&gt;
re.compile(&amp;#039;WWW-Authenticate:.*Digest.*&amp;quot;&amp;#039;,re.IGNORECASE|re.MULTILINE)&lt;br /&gt;
    m = rx.search(challenge)&lt;br /&gt;
    if m:&lt;br /&gt;
      self.params[&amp;#039;Digest&amp;#039;] = 1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  def get(self,keyword,default=None):&lt;br /&gt;
    if self.params.has_key(keyword):&lt;br /&gt;
      return self.params[keyword]&lt;br /&gt;
    else:&lt;br /&gt;
      return default&lt;br /&gt;
&lt;br /&gt;
  def no_challenge(self):&lt;br /&gt;
    return self.no_chal&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
class AbstractDigestAuthHandler:&lt;br /&gt;
    # Digest authentication is specified in RFC 2617.&lt;br /&gt;
&lt;br /&gt;
    # XXX The client does not inspect the Authentication-Info header&lt;br /&gt;
    # in a successful response.&lt;br /&gt;
&lt;br /&gt;
    # XXX It should be possible to test this implementation against&lt;br /&gt;
    # a mock server that just generates a static set of challenges.&lt;br /&gt;
&lt;br /&gt;
    # XXX qop=&amp;quot;auth-int&amp;quot; supports is shaky&lt;br /&gt;
&lt;br /&gt;
    def __init__(self, user, passwd):&lt;br /&gt;
        self.user = user&lt;br /&gt;
        self.passwd = passwd&lt;br /&gt;
        self.retried = 0&lt;br /&gt;
        self.nonce_count = 0&lt;br /&gt;
&lt;br /&gt;
    def reset_retry_count(self):&lt;br /&gt;
        self.retried = 0&lt;br /&gt;
&lt;br /&gt;
    def retry_http_digest_auth(self, req, auth):&lt;br /&gt;
        token, challenge = auth.split(&amp;#039; &amp;#039;, 1)&lt;br /&gt;
        chal = parse_keqv_list(parse_http_list(challenge))&lt;br /&gt;
        auth = self.get_authorization(req, chal)&lt;br /&gt;
        if auth:&lt;br /&gt;
            auth_val = &amp;#039;Digest %s&amp;#039; % auth&lt;br /&gt;
            if req.headers.get(self.auth_header, None) == auth_val:&lt;br /&gt;
                return None&lt;br /&gt;
            req.add_header(self.auth_header, auth_val)&lt;br /&gt;
            resp = self.parent.open(req)&lt;br /&gt;
            return resp&lt;br /&gt;
&lt;br /&gt;
    def get_cnonce(self, nonce):&lt;br /&gt;
        # The cnonce-value is an opaque&lt;br /&gt;
        # quoted string value provided by the client and used by both client&lt;br /&gt;
        # and server to avoid chosen plaintext attacks, to provide mutual&lt;br /&gt;
        # authentication, and to provide some message integrity protection.&lt;br /&gt;
        # This isn&amp;#039;t a fabulous effort, but it&amp;#039;s probably Good Enough.&lt;br /&gt;
        dig = sha.new(&amp;quot;%s:%s:%s:%s&amp;quot; % (self.nonce_count, nonce, time.ctime(),&lt;br /&gt;
                                       randombytes(8))).hexdigest()&lt;br /&gt;
        return dig[:16]&lt;br /&gt;
&lt;br /&gt;
    def get_authorization(self, chal, method, selector):&lt;br /&gt;
        try:&lt;br /&gt;
            realm = chal.get(&amp;#039;realm&amp;#039;)&lt;br /&gt;
            nonce = chal.get(&amp;#039;nonce&amp;#039;)&lt;br /&gt;
            qop = chal.get(&amp;#039;qop&amp;#039;)&lt;br /&gt;
            algorithm = chal.get(&amp;#039;algorithm&amp;#039;, &amp;#039;MD5&amp;#039;)&lt;br /&gt;
            # mod_digest doesn&amp;#039;t send an opaque, even though it isn&amp;#039;t&lt;br /&gt;
            # supposed to be optional&lt;br /&gt;
            opaque = chal.get(&amp;#039;opaque&amp;#039;, None)&lt;br /&gt;
        except KeyError:&lt;br /&gt;
            return None&lt;br /&gt;
&lt;br /&gt;
        H, KD = self.get_algorithm_impls(algorithm)&lt;br /&gt;
        if H is None:&lt;br /&gt;
            return None&lt;br /&gt;
&lt;br /&gt;
        user, pw = self.user, self.passwd&lt;br /&gt;
        if user is None:&lt;br /&gt;
            return None&lt;br /&gt;
&lt;br /&gt;
        # XXX not implemented yet&lt;br /&gt;
        entdig = None&lt;br /&gt;
        #if req.has_data():&lt;br /&gt;
        #    entdig = self.get_entity_digest(req.get_data(), chal)&lt;br /&gt;
&lt;br /&gt;
        A1 = &amp;quot;%s:%s:%s&amp;quot; % (user, realm, pw)&lt;br /&gt;
        A2 = &amp;quot;%s:%s&amp;quot; % (method,&lt;br /&gt;
                        # XXX selector: what about proxies and full urls&lt;br /&gt;
                        selector)&lt;br /&gt;
        if qop == &amp;#039;auth&amp;#039;:&lt;br /&gt;
            self.nonce_count += 1&lt;br /&gt;
            ncvalue = &amp;#039;%08x&amp;#039; % self.nonce_count&lt;br /&gt;
            cnonce = self.get_cnonce(nonce)&lt;br /&gt;
            noncebit = &amp;quot;%s:%s:%s:%s:%s&amp;quot; % (nonce, ncvalue, cnonce, qop, H(A2))&lt;br /&gt;
            respdig = KD(H(A1), noncebit)&lt;br /&gt;
        else:&lt;br /&gt;
            pass&lt;br /&gt;
        # XXX should the partial digests be encoded too?&lt;br /&gt;
&lt;br /&gt;
        base = &amp;#039;username=&amp;quot;%s&amp;quot;, realm=&amp;quot;%s&amp;quot;, nonce=&amp;quot;%s&amp;quot;, uri=&amp;quot;%s&amp;quot;, &amp;#039; \&lt;br /&gt;
               &amp;#039;response=&amp;quot;%s&amp;quot;&amp;#039; % (user, realm, nonce, selector,&lt;br /&gt;
                                  respdig)&lt;br /&gt;
        if opaque:&lt;br /&gt;
            base = base + &amp;#039;, opaque=&amp;quot;%s&amp;quot;&amp;#039; % opaque&lt;br /&gt;
        if entdig:&lt;br /&gt;
            base = base + &amp;#039;, digest=&amp;quot;%s&amp;quot;&amp;#039; % entdig&lt;br /&gt;
        if algorithm != &amp;#039;MD5&amp;#039;:&lt;br /&gt;
            base = base + &amp;#039;, algorithm=&amp;quot;%s&amp;quot;&amp;#039; % algorithm&lt;br /&gt;
        if qop:&lt;br /&gt;
            base = base + &amp;#039;, qop=auth, nc=%s, cnonce=&amp;quot;%s&amp;quot;&amp;#039; % (ncvalue, cnonce)&lt;br /&gt;
        return base&lt;br /&gt;
&lt;br /&gt;
    def get_algorithm_impls(self, algorithm):&lt;br /&gt;
        # lambdas assume digest modules are imported at the top level&lt;br /&gt;
        if algorithm == &amp;#039;MD5&amp;#039;:&lt;br /&gt;
            H = lambda x: md5.new(x).hexdigest()&lt;br /&gt;
        elif algorithm == &amp;#039;SHA&amp;#039;:&lt;br /&gt;
            H = lambda x: sha.new(x).hexdigest()&lt;br /&gt;
        # XXX MD5-sess&lt;br /&gt;
        KD = lambda s, d: H(&amp;quot;%s:%s&amp;quot; % (s, d))&lt;br /&gt;
        return H, KD&lt;br /&gt;
&lt;br /&gt;
    def get_entity_digest(self, data, chal):&lt;br /&gt;
        # XXX not implemented yet&lt;br /&gt;
        return None&lt;br /&gt;
&lt;br /&gt;
&amp;lt;---------------&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ethereal request sniffer: (the authorization request and server&lt;br /&gt;
response)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
No.     Time        Source                Destination&lt;br /&gt;
Protocol Info&lt;br /&gt;
     15 0.757244    192.168.0.106         64.4.58.250           HTTP&lt;br /&gt;
 POST /Find-30/FindService.asmx HTTP/1.1&lt;br /&gt;
&lt;br /&gt;
Frame 15 (612 bytes on wire, 612 bytes captured)&lt;br /&gt;
    Arrival Time: Sep  3, 2005 23:57:20.487466000&lt;br /&gt;
    Time delta from previous packet: 0.000111000 seconds&lt;br /&gt;
    Time since reference or first frame: 0.757244000 seconds&lt;br /&gt;
    Frame Number: 15&lt;br /&gt;
    Packet Length: 612 bytes&lt;br /&gt;
    Capture Length: 612 bytes&lt;br /&gt;
    Protocols in frame: eth:ip:tcp:http&lt;br /&gt;
Ethernet II, Src: FirstInt_6c:a0:01 (00:40:ca:6c:a0:01), Dst:&lt;br /&gt;
D-Link_36:0e:3d (00:0d:88:36:0e:3d)&lt;br /&gt;
    Destination: D-Link_36:0e:3d (00:0d:88:36:0e:3d)&lt;br /&gt;
    Source: FirstInt_6c:a0:01 (00:40:ca:6c:a0:01)&lt;br /&gt;
    Type: IP (0x0800)&lt;br /&gt;
Internet Protocol, Src: 192.168.0.106 (192.168.0.106), Dst: 64.4.58.250&lt;br /&gt;
(64.4.58.250)&lt;br /&gt;
    Version: 4&lt;br /&gt;
    Header length: 20 bytes&lt;br /&gt;
    Differentiated Services Field: 0x00 (DSCP 0x00: Default; ECN: 0x00)&lt;br /&gt;
        0000 00.. = Differentiated Services Codepoint: Default (0x00)&lt;br /&gt;
        .... ..0. = ECN-Capable Transport (ECT): 0&lt;br /&gt;
        .... ...0 = ECN-CE: 0&lt;br /&gt;
    Total Length: 598&lt;br /&gt;
    Identification: 0x7797 (30615)&lt;br /&gt;
    Flags: 0x04 (Don&amp;#039;t Fragment)&lt;br /&gt;
        0... = Reserved bit: Not set&lt;br /&gt;
        .1.. = Don&amp;#039;t fragment: Set&lt;br /&gt;
        ..0. = More fragments: Not set&lt;br /&gt;
    Fragment offset: 0&lt;br /&gt;
    Time to live: 128&lt;br /&gt;
    Protocol: TCP (0x06)&lt;br /&gt;
    Header checksum: 0x44fa [correct]&lt;br /&gt;
    Source: 192.168.0.106 (192.168.0.106)&lt;br /&gt;
    Destination: 64.4.58.250 (64.4.58.250)&lt;br /&gt;
Transmission Control Protocol, Src Port: 3183 (3183), Dst Port: http&lt;br /&gt;
(80), Seq: 1, Ack: 1, Len: 558&lt;br /&gt;
    Source port: 3183 (3183)&lt;br /&gt;
    Destination port: http (80)&lt;br /&gt;
    Sequence number: 1    (relative sequence number)&lt;br /&gt;
    Next sequence number: 559    (relative sequence number)&lt;br /&gt;
    Acknowledgement number: 1    (relative ack number)&lt;br /&gt;
    Header length: 20 bytes&lt;br /&gt;
    Flags: 0x0018 (PSH, ACK)&lt;br /&gt;
        0... .... = Congestion Window Reduced (CWR): Not set&lt;br /&gt;
        .0.. .... = ECN-Echo: Not set&lt;br /&gt;
        ..0. .... = Urgent: Not set&lt;br /&gt;
        ...1 .... = Acknowledgment: Set&lt;br /&gt;
        .... 1... = Push: Set&lt;br /&gt;
        .... .0.. = Reset: Not set&lt;br /&gt;
        .... ..0. = Syn: Not set&lt;br /&gt;
        .... ...0 = Fin: Not set&lt;br /&gt;
    Window size: 64512&lt;br /&gt;
    Checksum: 0x9143 [correct]&lt;br /&gt;
Hypertext Transfer Protocol&lt;br /&gt;
    POST /Find-30/FindService.asmx HTTP/1.1\r\n&lt;br /&gt;
        Request Method: POST&lt;br /&gt;
        Request URI: /Find-30/FindService.asmx&lt;br /&gt;
        Request Version: HTTP/1.1&lt;br /&gt;
    Host: findv3.staging.mappoint.net\r\n&lt;br /&gt;
    Accept-Encoding: identity\r\n&lt;br /&gt;
    User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services&lt;br /&gt;
Client Protocol 1.1.4322.573)\r\n&lt;br /&gt;
    SOAPAction: &amp;quot;http://s.mappoint.net/mappoint-30/FindAddress&amp;quot;\r\n&lt;br /&gt;
    Authorization: Digest username=&amp;quot;106288&amp;quot;, realm=&amp;quot;MapPoint&amp;quot;,&lt;br /&gt;
nonce=&amp;quot;8033d257de12190a048487521100021388b534e89ffd4bad4292666e620c&amp;quot;,&lt;br /&gt;
uri=&amp;quot;/Find-30/FindService.asmx&amp;quot;,&lt;br /&gt;
response=&amp;quot;0ff36d6cbaf353f4aba183cef52d1de9&amp;quot;, qop=auth, nc=00000001,&lt;br /&gt;
cnonce=&amp;quot;8&lt;br /&gt;
    Content-length: 0\r\n&lt;br /&gt;
    Expect: 100-continue\r\n&lt;br /&gt;
    \r\n&lt;br /&gt;
&lt;br /&gt;
0000  00 0d 88 36 0e 3d 00 40 ca 6c a0 01 08 00 45 00&lt;br /&gt;
...6.=. at .l....E.&lt;br /&gt;
0010  02 56 77 97 40 00 80 06 44 fa c0 a8 00 6a 40 04&lt;br /&gt;
.Vw. at ...D....j@.&lt;br /&gt;
0020  3a fa 0c 6f 00 50 88 c9 eb f1 f0 ea 88 6f 50 18&lt;br /&gt;
:..o.P.......oP.&lt;br /&gt;
0030  fc 00 91 43 00 00 50 4f 53 54 20 2f 46 69 6e 64   ...C..POST&lt;br /&gt;
/Find&lt;br /&gt;
0040  2d 33 30 2f 46 69 6e 64 53 65 72 76 69 63 65 2e&lt;br /&gt;
-30/FindService.&lt;br /&gt;
0050  61 73 6d 78 20 48 54 54 50 2f 31 2e 31 0d 0a 48   asmx&lt;br /&gt;
HTTP/1.1..H&lt;br /&gt;
0060  6f 73 74 3a 20 66 69 6e 64 76 33 2e 73 74 61 67   ost:&lt;br /&gt;
findv3.stag&lt;br /&gt;
0070  69 6e 67 2e 6d 61 70 70 6f 69 6e 74 2e 6e 65 74&lt;br /&gt;
ing.mappoint.net&lt;br /&gt;
0080  0d 0a 41 63 63 65 70 74 2d 45 6e 63 6f 64 69 6e&lt;br /&gt;
..Accept-Encodin&lt;br /&gt;
0090  67 3a 20 69 64 65 6e 74 69 74 79 0d 0a 55 73 65   g:&lt;br /&gt;
identity..Use&lt;br /&gt;
00a0  72 2d 41 67 65 6e 74 3a 20 4d 6f 7a 69 6c 6c 61   r-Agent:&lt;br /&gt;
Mozilla&lt;br /&gt;
00b0  2f 34 2e 30 20 28 63 6f 6d 70 61 74 69 62 6c 65   /4.0&lt;br /&gt;
(compatible&lt;br /&gt;
00c0  3b 20 4d 53 49 45 20 36 2e 30 3b 20 4d 53 20 57   ; MSIE 6.0; MS&lt;br /&gt;
W&lt;br /&gt;
00d0  65 62 20 53 65 72 76 69 63 65 73 20 43 6c 69 65   eb Services&lt;br /&gt;
Clie&lt;br /&gt;
00e0  6e 74 20 50 72 6f 74 6f 63 6f 6c 20 31 2e 31 2e   nt Protocol&lt;br /&gt;
1.1.&lt;br /&gt;
00f0  34 33 32 32 2e 35 37 33 29 0d 0a 53 4f 41 50 41&lt;br /&gt;
4322.573)..SOAPA&lt;br /&gt;
0100  63 74 69 6f 6e 3a 20 22 68 74 74 70 3a 2f 2f 73   ction:&lt;br /&gt;
&amp;quot;http://s&lt;br /&gt;
0110  2e 6d 61 70 70 6f 69 6e 74 2e 6e 65 74 2f 6d 61&lt;br /&gt;
.mappoint.net/ma&lt;br /&gt;
0120  70 70 6f 69 6e 74 2d 33 30 2f 46 69 6e 64 41 64&lt;br /&gt;
ppoint-30/FindAd&lt;br /&gt;
0130  64 72 65 73 73 22 0d 0a 41 75 74 68 6f 72 69 7a&lt;br /&gt;
dress&amp;quot;..Authoriz&lt;br /&gt;
0140  61 74 69 6f 6e 3a 20 44 69 67 65 73 74 20 75 73   ation: Digest&lt;br /&gt;
us&lt;br /&gt;
0150  65 72 6e 61 6d 65 3d 22 31 30 36 32 38 38 22 2c&lt;br /&gt;
ername=&amp;quot;106288&amp;quot;,&lt;br /&gt;
0160  20 72 65 61 6c 6d 3d 22 4d 61 70 50 6f 69 6e 74&lt;br /&gt;
realm=&amp;quot;MapPoint&lt;br /&gt;
0170  22 2c 20 6e 6f 6e 63 65 3d 22 38 30 33 33 64 32   &amp;quot;,&lt;br /&gt;
nonce=&amp;quot;8033d2&lt;br /&gt;
0180  35 37 64 65 31 32 31 39 30 61 30 34 38 34 38 37&lt;br /&gt;
57de12190a048487&lt;br /&gt;
0190  35 32 31 31 30 30 30 32 31 33 38 38 62 35 33 34&lt;br /&gt;
521100021388b534&lt;br /&gt;
01a0  65 38 39 66 66 64 34 62 61 64 34 32 39 32 36 36&lt;br /&gt;
e89ffd4bad429266&lt;br /&gt;
01b0  36 65 36 32 30 63 22 2c 20 75 72 69 3d 22 2f 46   6e620c&amp;quot;,&lt;br /&gt;
uri=&amp;quot;/F&lt;br /&gt;
01c0  69 6e 64 2d 33 30 2f 46 69 6e 64 53 65 72 76 69&lt;br /&gt;
ind-30/FindServi&lt;br /&gt;
01d0  63 65 2e 61 73 6d 78 22 2c 20 72 65 73 70 6f 6e   ce.asmx&amp;quot;,&lt;br /&gt;
respon&lt;br /&gt;
01e0  73 65 3d 22 30 66 66 33 36 64 36 63 62 61 66 33&lt;br /&gt;
se=&amp;quot;0ff36d6cbaf3&lt;br /&gt;
01f0  35 33 66 34 61 62 61 31 38 33 63 65 66 35 32 64&lt;br /&gt;
53f4aba183cef52d&lt;br /&gt;
0200  31 64 65 39 22 2c 20 71 6f 70 3d 61 75 74 68 2c   1de9&amp;quot;,&lt;br /&gt;
qop=auth,&lt;br /&gt;
0210  20 6e 63 3d 30 30 30 30 30 30 30 31 2c 20 63 6e    nc=00000001,&lt;br /&gt;
cn&lt;br /&gt;
0220  6f 6e 63 65 3d 22 38 61 63 33 34 34 37 33 63 33&lt;br /&gt;
once=&amp;quot;8ac34473c3&lt;br /&gt;
0230  33 32 66 61 38 66 22 0d 0a 43 6f 6e 74 65 6e 74&lt;br /&gt;
32fa8f&amp;quot;..Content&lt;br /&gt;
0240  2d 6c 65 6e 67 74 68 3a 20 30 0d 0a 45 78 70 65   -length:&lt;br /&gt;
0..Expe&lt;br /&gt;
0250  63 74 3a 20 31 30 30 2d 63 6f 6e 74 69 6e 75 65   ct:&lt;br /&gt;
100-continue&lt;br /&gt;
0260  0d 0a 0d 0a                                       ....&lt;br /&gt;
&lt;br /&gt;
No.     Time        Source                Destination&lt;br /&gt;
Protocol Info&lt;br /&gt;
     16 0.950469    64.4.58.250           192.168.0.106         HTTP&lt;br /&gt;
 HTTP/1.1 401 Unauthorized&lt;br /&gt;
&lt;br /&gt;
Frame 16 (387 bytes on wire, 387 bytes captured)&lt;br /&gt;
    Arrival Time: Sep  3, 2005 23:57:20.680691000&lt;br /&gt;
    Time delta from previous packet: 0.193225000 seconds&lt;br /&gt;
    Time since reference or first frame: 0.950469000 seconds&lt;br /&gt;
    Frame Number: 16&lt;br /&gt;
    Packet Length: 387 bytes&lt;br /&gt;
    Capture Length: 387 bytes&lt;br /&gt;
    Protocols in frame: eth:ip:tcp:http&lt;br /&gt;
Ethernet II, Src: D-Link_36:0e:3d (00:0d:88:36:0e:3d), Dst:&lt;br /&gt;
FirstInt_6c:a0:01 (00:40:ca:6c:a0:01)&lt;br /&gt;
    Destination: FirstInt_6c:a0:01 (00:40:ca:6c:a0:01)&lt;br /&gt;
    Source: D-Link_36:0e:3d (00:0d:88:36:0e:3d)&lt;br /&gt;
    Type: IP (0x0800)&lt;br /&gt;
Internet Protocol, Src: 64.4.58.250 (64.4.58.250), Dst: 192.168.0.106&lt;br /&gt;
(192.168.0.106)&lt;br /&gt;
    Version: 4&lt;br /&gt;
    Header length: 20 bytes&lt;br /&gt;
    Differentiated Services Field: 0x00 (DSCP 0x00: Default; ECN: 0x00)&lt;br /&gt;
        0000 00.. = Differentiated Services Codepoint: Default (0x00)&lt;br /&gt;
        .... ..0. = ECN-Capable Transport (ECT): 0&lt;br /&gt;
        .... ...0 = ECN-CE: 0&lt;br /&gt;
    Total Length: 373&lt;br /&gt;
    Identification: 0x395f (14687)&lt;br /&gt;
    Flags: 0x04 (Don&amp;#039;t Fragment)&lt;br /&gt;
        0... = Reserved bit: Not set&lt;br /&gt;
        .1.. = Don&amp;#039;t fragment: Set&lt;br /&gt;
        ..0. = More fragments: Not set&lt;br /&gt;
    Fragment offset: 0&lt;br /&gt;
    Time to live: 108&lt;br /&gt;
    Protocol: TCP (0x06)&lt;br /&gt;
    Header checksum: 0x9813 [correct]&lt;br /&gt;
    Source: 64.4.58.250 (64.4.58.250)&lt;br /&gt;
    Destination: 192.168.0.106 (192.168.0.106)&lt;br /&gt;
Transmission Control Protocol, Src Port: http (80), Dst Port: 3183&lt;br /&gt;
(3183), Seq: 1, Ack: 559, Len: 333&lt;br /&gt;
    Source port: http (80)&lt;br /&gt;
    Destination port: 3183 (3183)&lt;br /&gt;
    Sequence number: 1    (relative sequence number)&lt;br /&gt;
    Next sequence number: 334    (relative sequence number)&lt;br /&gt;
    Acknowledgement number: 559    (relative ack number)&lt;br /&gt;
    Header length: 20 bytes&lt;br /&gt;
    Flags: 0x0018 (PSH, ACK)&lt;br /&gt;
        0... .... = Congestion Window Reduced (CWR): Not set&lt;br /&gt;
        .0.. .... = ECN-Echo: Not set&lt;br /&gt;
        ..0. .... = Urgent: Not set&lt;br /&gt;
        ...1 .... = Acknowledgment: Set&lt;br /&gt;
        .... 1... = Push: Set&lt;br /&gt;
        .... .0.. = Reset: Not set&lt;br /&gt;
        .... ..0. = Syn: Not set&lt;br /&gt;
        .... ...0 = Fin: Not set&lt;br /&gt;
    Window size: 17122&lt;br /&gt;
    Checksum: 0x0f4b [correct]&lt;br /&gt;
    SEQ/ACK analysis&lt;br /&gt;
        This is an ACK to the segment in frame: 15&lt;br /&gt;
        The RTT to ACK the segment was: 0.193225000 seconds&lt;br /&gt;
Hypertext Transfer Protocol&lt;br /&gt;
    HTTP/1.1 401 Unauthorized\r\n&lt;br /&gt;
        Request Version: HTTP/1.1&lt;br /&gt;
        Response Code: 401&lt;br /&gt;
    Connection: close\r\n&lt;br /&gt;
    Date: Sat, 03 Sep 2005 22:00:41 GMT\r\n&lt;br /&gt;
    Server: Microsoft-IIS/6.0\r\n&lt;br /&gt;
    P3P:CP=&amp;quot;BUS CUR CONo FIN IVDo ONL OUR PHY SAMo TELo&amp;quot;\r\n&lt;br /&gt;
    X-Powered-By: ASP.NET\r\n&lt;br /&gt;
    WWW-Authenticate: Digest qop=&amp;quot;auth&amp;quot;, realm=&amp;quot;MapPoint&amp;quot;,&lt;br /&gt;
nonce=&amp;quot;13c38f357408a1fc148487521100702d0fadd05e6b7cf54806565713c790&amp;quot;\r\n&lt;br /&gt;
    Content-Length: 0\r\n&lt;br /&gt;
    \r\n&lt;br /&gt;
&lt;br /&gt;
0000  00 40 ca 6c a0 01 00 0d 88 36 0e 3d 08 00 45 00  . at .l.....6.=..E.&lt;br /&gt;
0010  01 75 39 5f 40 00 6c 06 98 13 40 04 3a fa c0 a8  .u9_ at .l...@.:...&lt;br /&gt;
0020  00 6a 00 50 0c 6f f0 ea 88 6f 88 c9 ee 1f 50 18  .j.P.o...o....P.&lt;br /&gt;
0030  42 e2 0f 4b 00 00 48 54 54 50 2f 31 2e 31 20 34   B..K..HTTP/1.14&lt;br /&gt;
0040  30 31 20 55 6e 61 75 74 68 6f 72 69 7a 65 64 0d   01 Unauthorized.&lt;br /&gt;
0050  0a 43 6f 6e 6e 65 63 74 69 6f 6e 3a 20 63 6c 6f   .Connection: clo&lt;br /&gt;
0060  73 65 0d 0a 44 61 74 65 3a 20 53 61 74 2c 20 30   se..Date: Sat, 0&lt;br /&gt;
0070  33 20 53 65 70 20 32 30 30 35 20 32 32 3a 30 30   3 Sep 2005 22:00&lt;br /&gt;
0080  3a 34 31 20 47 4d 54 0d 0a 53 65 72 76 65 72 3a   :41 GMT..Server:&lt;br /&gt;
0090  20 4d 69 63 72 6f 73 6f 66 74 2d 49 49 53 2f 36   Microsoft-IIS/6&lt;br /&gt;
00a0  2e 30 0d 0a 50 33 50 3a 43 50 3d 22 42 55 53 20   .0..P3P:CP=&amp;quot;BUS&lt;br /&gt;
&lt;br /&gt;
00b0  43 55 52 20 43 4f 4e 6f 20 46 49 4e 20 49 56 44   CUR CONo FINIVD&lt;br /&gt;
00c0  6f 20 4f 4e 4c 20 4f 55 52 20 50 48 59 20 53 41   o ONL OUR PHYSA&lt;br /&gt;
00d0  4d 6f 20 54 45 4c 6f 22 0d 0a 58 2d 50 6f 77 65   MoTELo&amp;quot;..X-Powe&lt;br /&gt;
00e0  72 65 64 2d 42 79 3a 20 41 53 50 2e 4e 45 54 0d   red-By:ASP.NET.&lt;br /&gt;
00f0  0a 57 57 57 2d 41 75 74 68 65 6e 74 69 63 61 74   .WWW-Authenticat&lt;br /&gt;
0100  65 3a 20 44 69 67 65 73 74 20 71 6f 70 3d 22 61   e: Digestqop=&amp;quot;a&lt;br /&gt;
0110  75 74 68 22 2c 20 72 65 61 6c 6d 3d 22 4d 61 70   uth&amp;quot;,realm=&amp;quot;Map&lt;br /&gt;
0120  50 6f 69 6e 74 22 2c 20 6e 6f 6e 63 65 3d 22 31   Point&amp;quot;,nonce=&amp;quot;1&lt;br /&gt;
0130  33 63 33 38 66 33 35 37 34 30 38 61 31 66 63 31   3c38f357408a1fc1&lt;br /&gt;
0140  34 38 34 38 37 35 32 31 31 30 30 37 30 32 64 30   48487521100702d0&lt;br /&gt;
0150  66 61 64 64 30 35 65 36 62 37 63 66 35 34 38 30   fadd05e6b7cf5480&lt;br /&gt;
0160  36 35 36 35 37 31 33 63 37 39 30 22 0d 0a 43 6f   6565713c790&amp;quot;..Co&lt;br /&gt;
0170  6e 74 65 6e 74 2d 4c 65 6e 67 74 68 3a 20 30 0d   ntent-Length:0.&lt;br /&gt;
0180  0a 0d 0a                                          ...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    * Previous message: PyChecker lives, version 0.8.15 released&lt;br /&gt;
    * Next message: Digest MD5 authentication over using ZSI&lt;br /&gt;
    * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]&lt;br /&gt;
&lt;br /&gt;
More information about the Python-list mailing list&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= NTLM Authentication =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Re: NTLM Authentication&lt;br /&gt;
Subject: 	Re: NTLM Authentication&lt;br /&gt;
List-id: 	Discussion of Python and Web services &amp;lt;pywebsvcs-talk.lists.sourceforge.net&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;gt; Date: Fri, 17 Nov 2006 10:50:56 -0500&lt;br /&gt;
&amp;gt; From: Chris Lambacher &amp;lt;chris@xxxxxxxxxxxxxxxx&amp;gt;&lt;br /&gt;
&amp;gt; Subject: Re: [Pywebsvcs-talk] NTLM Authentication&lt;br /&gt;
&amp;gt; To: Charlie Moad &amp;lt;cwmoad@xxxxxxxxx&amp;gt;&lt;br /&gt;
&amp;gt; Cc: pywebsvcs-talk &amp;lt;pywebsvcs-talk@xxxxxxxxxxxxxxxxxxxxx&amp;gt;&lt;br /&gt;
&amp;gt; Message-ID: &amp;lt;20061117155056.GA16275@xxxxxxxxxxxxxxxx&amp;gt;&lt;br /&gt;
&amp;gt; Content-Type: text/plain; charset=us-ascii&lt;br /&gt;
&amp;gt;&lt;br /&gt;
&amp;gt; On Fri, Nov 17, 2006 at 09:26:01AM -0500, Charlie Moad wrote:&lt;br /&gt;
&amp;gt; &amp;gt; Has anyone ever done, or know how to do NTLM authentication&lt;br /&gt;
&amp;gt; with ZSI?&lt;br /&gt;
&amp;gt; ZSI uses httplib from the standard library to perform HTTP&lt;br /&gt;
&amp;gt; communication.&lt;br /&gt;
&amp;gt; Nothing in the standard library supports NTLM authentication.&lt;br /&gt;
&amp;gt;  You will have&lt;br /&gt;
&amp;gt; to do a lot of fiddling to get this to work.  You can find a python&lt;br /&gt;
&amp;gt; implementation at:&lt;br /&gt;
&amp;gt; http://ntlmaps.sourceforge.net/&lt;br /&gt;
&amp;gt;&lt;br /&gt;
&amp;gt; It provides a proxy, which might be a sufficient solution for you.&lt;br /&gt;
&amp;gt;&lt;br /&gt;
&amp;gt; -Chris&lt;br /&gt;
&amp;gt;&lt;br /&gt;
NTLMaps does its job quite well in my experience.&lt;br /&gt;
&lt;br /&gt;
I wrote a ZSI_Transport module to pass to client.Binding.&lt;br /&gt;
It emulates enough of httplib.HTTPConnection to satisfy ZSI, and&lt;br /&gt;
calls urllib2 to handle the proxy. That&amp;#039;s kind of an upside down&lt;br /&gt;
approach, since in my opinion, ZSI should be using urllib2&lt;br /&gt;
directly, but it gets the job done. I&amp;#039;m using it with 2.0rc2.&lt;br /&gt;
I don&amp;#039;t know if the approach is still valid with the latest&lt;br /&gt;
release.&lt;br /&gt;
&lt;br /&gt;
I haven&amp;#039;t obtained permission from my employer to publish the&lt;br /&gt;
code, but I&amp;#039;d be happy to answer any questions I can about how&lt;br /&gt;
I did it.&lt;br /&gt;
&lt;br /&gt;
This email and any files transmitted with it are confidential and are intended&lt;br /&gt;
solely for the use of the individual or entity to whom they are addressed.  If&lt;br /&gt;
you are not the original recipient or the person responsible for delivering the&lt;br /&gt;
email to the intended recipient, be advised that you have received this email&lt;br /&gt;
in error, and that any use, dissemination, forwarding, printing, or copying of&lt;br /&gt;
this email is strictly prohibited. If you received this email in error, please&lt;br /&gt;
immediately notify the sender and delete the original.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>PeterHarding</name></author>
	</entry>
</feed>