Example #1
0
 def _handle_challenge(self, e):
     self.log(e)
     response_token = None
     params = challenge_to_dict(e.xml_text)
     # Handling 'rspauth' token in DIGEST-MD5
     # See section 2.1.3 of RFC 2831
     if 'rspauth' not in params:
         digest_uri = 'xmpp/%s' % self.jid.domain
         password = self.password_lookup(self.jid)
         response_token = compute_digest_response(params, self.jid.node,
                                                  password, digest_uri=digest_uri)
         
     response = E(u'response', content=response_token, namespace=XMPP_SASL_NS)
     self.propagate(element=response)
Example #2
0
 def handle_challenge(self, e):
     """
     Handles the authentication by computing the
     challenge for the provided credentials.
     """
     response_token = None
     params = challenge_to_dict(e.xml_text)
     # Handling 'rspauth' token in DIGEST-MD5
     # See section 2.1.3 of RFC 2831
     if 'rspauth' not in params:
         digest_uri = 'xmpp/%s' % self.jid.domain
         password = self.password
         response_token = compute_digest_response(params, self.jid.node,
                                                  password, digest_uri=digest_uri)
         
     return E(u'response', content=response_token, namespace=XMPP_SASL_NS)
Example #3
0
    def handle_challenge(self, e):
        """
        Handles the authentication by computing the
        challenge for the provided credentials.
        """
        response_token = None
        params = challenge_to_dict(e.xml_text)
        # Handling 'rspauth' token in DIGEST-MD5
        # See section 2.1.3 of RFC 2831
        if 'rspauth' not in params:
            digest_uri = 'xmpp/%s' % self.jid.domain
            password = self.password
            response_token = compute_digest_response(params,
                                                     self.jid.node,
                                                     password,
                                                     digest_uri=digest_uri)

        return E(u'response', content=response_token, namespace=XMPP_SASL_NS)