:right-sidebar: True AuthManager =================================================================== .. currentmodule:: gi.repository.Soup .. class:: AuthManager(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.GObject.Object` Implemented Interfaces: :class:`~gi.repository.Soup.SessionFeature` HTTP client-side authentication handler. :obj:`~gi.repository.Soup.AuthManager` is the :obj:`~gi.repository.Soup.SessionFeature` that handles HTTP authentication for a :obj:`~gi.repository.Soup.Session`\. A :obj:`~gi.repository.Soup.AuthManager` is added to the session by default, and normally you don't need to worry about it at all. However, if you want to disable HTTP authentication, you can remove the feature from the session with :obj:`~gi.repository.Session.remove_feature_by_type` or disable it on individual requests with :obj:`~gi.repository.Message.disable_feature`\. You can use this with :obj:`~gi.repository.Session.remove_feature_by_type` or :obj:`~gi.repository.Message.disable_feature`\. (Although this type has only been publicly visible since libsoup 2.42, it has always existed in the background, and you can use ``g_type_from_name ("SoupAuthManager")`` to get its [alias``GObject``\.Type] in earlier releases.) Methods ------- .. rst-class:: interim-class .. class:: AuthManager :no-index: .. method:: clear_cached_credentials() -> None Clear all credentials cached by ``manager``\. .. method:: use_auth(uri: ~gi.repository.GLib.Uri, auth: ~gi.repository.Soup.Auth) -> None Records that ``auth`` is to be used under ``uri``\, as though a WWW-Authenticate header had been received at that URI. This can be used to "preload" ``manager``\'s auth cache, to avoid an extra HTTP round trip in the case where you know ahead of time that a 401 response will be returned. This is only useful for authentication types where the initial Authorization header does not depend on any additional information from the server. (Eg, Basic or NTLM, but not Digest.) :param uri: the :obj:`~gi.repository.GLib.Uri` under which ``auth`` is to be used :param auth: the :obj:`~gi.repository.Soup.Auth` to use