:right-sidebar: True AuthenticationRequest =================================================================== .. currentmodule:: gi.repository.WebKit .. class:: AuthenticationRequest(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.GObject.Object` Represents an authentication request. Whenever a client attempts to load a page protected by HTTP authentication, credentials will need to be provided to authorize access. To allow the client to decide how it wishes to handle authentication, WebKit will fire a :obj:`~gi.repository.WebKit.WebView`\::authenticate signal with a WebKitAuthenticationRequest object to provide client side authentication support. Credentials are exposed through the :obj:`~gi.repository.WebKit.Credential` object. In case the client application does not wish to handle this signal WebKit will provide a default handler. To handle authentication asynchronously, simply increase the reference count of the WebKitAuthenticationRequest object. Methods ------- .. rst-class:: interim-class .. class:: AuthenticationRequest :no-index: .. method:: authenticate(credential: ~gi.repository.WebKit.Credential | None = None) -> None Authenticate the :obj:`~gi.repository.WebKit.AuthenticationRequest`\. Authenticate the :obj:`~gi.repository.WebKit.AuthenticationRequest` using the :obj:`~gi.repository.WebKit.Credential` supplied. To continue without credentials, pass :const:`None` as ``credential``\. .. versionadded:: 2.2 :param credential: A :obj:`~gi.repository.WebKit.Credential`\, or :const:`None` .. method:: can_save_credentials() -> bool Determine whether this :obj:`~gi.repository.WebKit.AuthenticationRequest` should allow the storage of credentials. Determine whether the authentication method associated with this :obj:`~gi.repository.WebKit.AuthenticationRequest` should allow the storage of credentials. This will return :const:`False` if WebKit doesn't support credential storing, if private browsing is enabled, or if persistent credential storage has been disabled in :obj:`~gi.repository.WebKit.WebsiteDataManager`\, unless credentials saving has been explicitly enabled with :func:`~gi.repository.WebKit.AuthenticationRequest.set_can_save_credentials`. .. versionadded:: 2.2 .. method:: cancel() -> None Cancel the authentication challenge. This will also cancel the page loading and result in a :obj:`~gi.repository.WebKit.WebView`\::load-failed signal with a ``WebKitNetworkError`` of type :const:`~gi.repository.WebKit.NetworkError.CANCELLED` being emitted. .. versionadded:: 2.2 .. method:: get_certificate_pin_flags() -> ~gi.repository.Gio.TlsPasswordFlags Get the :obj:`~gi.repository.Gio.TlsPasswordFlags` of the :const:`~gi.repository.WebKit.AuthenticationScheme.CLIENT_CERTIFICATE_PIN_REQUESTED` authentication challenge. .. versionadded:: 2.34 .. method:: get_host() -> str Get the host that this authentication challenge is applicable to. .. versionadded:: 2.2 .. method:: get_port() -> int Get the port that this authentication challenge is applicable to. .. versionadded:: 2.2 .. method:: get_proposed_credential() -> ~gi.repository.WebKit.Credential Get the :obj:`~gi.repository.WebKit.Credential` of the proposed authentication challenge. Get the :obj:`~gi.repository.WebKit.Credential` of the proposed authentication challenge that was stored from a previous session. The client can use this directly for authentication or construct their own :obj:`~gi.repository.WebKit.Credential`\. .. versionadded:: 2.2 .. method:: get_realm() -> str Get the realm that this authentication challenge is applicable to. .. versionadded:: 2.2 .. method:: get_scheme() -> ~gi.repository.WebKit.AuthenticationScheme Get the authentication scheme of the authentication challenge. .. versionadded:: 2.2 .. method:: get_security_origin() -> ~gi.repository.WebKit.SecurityOrigin Get the :obj:`~gi.repository.WebKit.SecurityOrigin` that this authentication challenge is applicable to. .. versionadded:: 2.30 .. method:: is_for_proxy() -> bool Determine whether the authentication challenge is associated with a proxy server. Determine whether the authentication challenge is associated with a proxy server rather than an "origin" server. .. versionadded:: 2.2 .. method:: is_retry() -> bool Determine whether this this is a first attempt or a retry for this authentication challenge. .. versionadded:: 2.2 .. method:: set_can_save_credentials(enabled: bool) -> None Set whether the authentication method associated with ``request`` should allow the storage of credentials. Set whether the authentication method associated with ``request`` should allow the storage of credentials. This should be used by applications handling their own credentials storage to indicate that it should be supported even when internal credential storage is disabled or unsupported. Note that storing of credentials will not be allowed on ephemeral sessions in any case. .. versionadded:: 2.30 :param enabled: value to set .. method:: set_proposed_credential(credential: ~gi.repository.WebKit.Credential) -> None Set the :obj:`~gi.repository.WebKit.Credential` of the proposed authentication challenge. Set the :obj:`~gi.repository.WebKit.Credential` of the proposed authentication challenge that was stored from a previous session. This should only be used by applications handling their own credential storage. (When using the default WebKit credential storage, :func:`~gi.repository.WebKit.AuthenticationRequest.get_proposed_credential` already contains previously-stored credentials.) Passing a :const:`None` ``credential`` will clear the proposed credential. .. versionadded:: 2.30 :param credential: a :obj:`~gi.repository.WebKit.Credential`\, or :const:`None` Signals ------- .. rst-class:: interim-class .. class:: AuthenticationRequest.signals :no-index: .. method:: authenticated(credential: ~gi.repository.WebKit.Credential) -> None The type of the None singleton. .. versionadded:: 2.30 :param credential: the :obj:`~gi.repository.WebKit.Credential` accepted .. method:: cancelled() -> None The type of the None singleton. .. versionadded:: 2.2