'A generator that creates Authorization objects
that can be applied to requests.'

def _auth_from_challenge(self, host, request_uri, headers, response, content):

    challenges = _parse_www_authenticate(response, 'www-authenticate')
    for cred in self.credentials.iter(host):
        for scheme in AUTH_SCHEME_ORDER:
            if challenges.has_key(scheme):
                (yield AUTH_SCHEME_CLASSES[scheme](cred, host, request_uri, headers, response, content, self))
