:right-sidebar: True AuthDomainDigest =================================================================== .. currentmodule:: gi.repository.Soup .. class:: AuthDomainDigest(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.Soup.AuthDomain`, :class:`~gi.repository.GObject.Object` Server-side "Digest" authentication. ``SoupAuthDomainDigest`` handles the server side of HTTP "Digest" authentication. Methods ------- .. rst-class:: interim-class .. class:: AuthDomainDigest :no-index: .. classmethod:: encode_password(realm: str, password: str) -> str Encodes the username/realm/password triplet for Digest authentication. That is, it returns a stringified MD5 hash of ``username``\, ``realm``\, and ``password`` concatenated together. This is the form that is needed as the return value of ``SoupAuthDomainDigest``'s auth handler. For security reasons, you should store the encoded hash, rather than storing the cleartext password itself and calling this method only when you need to verify it. This way, if your server is compromised, the attackers will not gain access to cleartext passwords which might also be usable at other sites. (Note also that the encoded password returned by this method is identical to the encoded password stored in an Apache .htdigest file.) :param realm: an auth realm name :param password: the password for ``username`` in ``realm`` .. method:: set_auth_callback(callback: ~typing.Callable[[~gi.repository.Soup.AuthDomainDigest, ~gi.repository.Soup.ServerMessage, str, ~typing.Any], str | None], user_data: ~typing.Any = None) -> None Sets the callback that ``domain`` will use to authenticate incoming requests. For each request containing authorization, ``domain`` will invoke the callback, and then either accept or reject the request based on ``callback``\'s return value. You can also set the auth callback by setting the :obj:`~gi.repository.Soup.AuthDomainDigest.props.auth_callback` and :obj:`~gi.repository.Soup.AuthDomainDigest.props.auth_data` properties, which can also be used to set the callback at construct time. :param callback: the callback :param user_data: data to pass to ``auth_callback`` Properties ---------- .. rst-class:: interim-class .. class:: AuthDomainDigest :no-index: .. attribute:: props.auth_callback :type: ~typing.Callable[[~gi.repository.Soup.AuthDomainDigest, ~gi.repository.Soup.ServerMessage, str, ~typing.Any], str | None] The type of the None singleton. .. attribute:: props.auth_data :type: ~typing.Any The type of the None singleton.