def digestAuth(realm, algorithm=MD5, nonce=None, qop=AUTH):
 global SUPPORTED_ALGORITHM, DIGEST_AUTH_ENCODERS, SUPPORTED_QOP
 assert (algorithm in SUPPORTED_ALGORITHM)
 assert (qop in SUPPORTED_QOP)
 if (nonce is None):
  nonce = calculateNonce(realm, algorithm)
 return ('Digest realm="%s", nonce="%s", algorithm="%s", qop="%s"' % (realm, nonce, algorithm, qop))

def digestAuth ( realm , algorithm = MD5 , nonce = None , qop = AUTH ) : global SUPPORTED_ALGORITHM , DIGEST_AUTH_ENCODERS , SUPPORTED_QOP assert ( algorithm in SUPPORTED_ALGORITHM ) assert ( qop in SUPPORTED_QOP ) if ( nonce is None ) : nonce = calculateNonce ( realm , algorithm ) return ( 'Digest realm="%s", nonce="%s", algorithm="%s", qop="%s"' % ( realm , nonce , algorithm , qop ) )
challenges the client for a digest authentication .