WebKit.AuthenticationRequest

g GObject.Object GObject.Object WebKit.AuthenticationRequest WebKit.AuthenticationRequest GObject.Object->WebKit.AuthenticationRequest

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

authenticate (credential)

can_save_credentials ()

cancel ()

get_certificate_pin_flags ()

get_host ()

get_port ()

get_proposed_credential ()

get_realm ()

get_scheme ()

get_security_origin ()

is_for_proxy ()

is_retry ()

set_can_save_credentials (enabled)

set_proposed_credential (credential)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

None

Signals

Inherited:

GObject.Object (1)

Name

Short Description

authenticated

This signal is emitted when the user authentication request succeeded.

cancelled

This signal is emitted when the user authentication request is cancelled.

Fields

Inherited:

GObject.Object (1)

Class Details

class WebKit.AuthenticationRequest(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

WebKit.AuthenticationRequestClass

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 WebKit.WebView ::authenticate signal with a WebKit.AuthenticationRequest object to provide client side authentication support. Credentials are exposed through the 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 WebKit.AuthenticationRequest object.

authenticate(credential)
Parameters:

credential (WebKit.Credential or None) – A WebKit.Credential, or None

Authenticate the WebKit.AuthenticationRequest.

Authenticate the WebKit.AuthenticationRequest using the WebKit.Credential supplied. To continue without credentials, pass None as credential.

New in version 2.2.

can_save_credentials()
Returns:

True if WebKit can store credentials or False otherwise.

Return type:

bool

Determine whether this WebKit.AuthenticationRequest should allow the storage of credentials.

Determine whether the authentication method associated with this WebKit.AuthenticationRequest should allow the storage of credentials. This will return False if WebKit doesn’t support credential storing, if private browsing is enabled, or if persistent credential storage has been disabled in WebKit.WebsiteDataManager, unless credentials saving has been explicitly enabled with WebKit.AuthenticationRequest.set_can_save_credentials().

New in version 2.2.

cancel()

Cancel the authentication challenge.

This will also cancel the page loading and result in a WebKit.WebView ::load-failed signal with a WebKit.NetworkError of type WebKit.NetworkError.CANCELLED being emitted.

New in version 2.2.

get_certificate_pin_flags()
Returns:

a Gio.TlsPasswordFlags

Return type:

Gio.TlsPasswordFlags

Get the Gio.TlsPasswordFlags of the WebKit.AuthenticationScheme.CLIENT_CERTIFICATE_PIN_REQUESTED authentication challenge.

New in version 2.34.

get_host()
Returns:

The host of self.

Return type:

str

Get the host that this authentication challenge is applicable to.

New in version 2.2.

get_port()
Returns:

The port of self.

Return type:

int

Get the port that this authentication challenge is applicable to.

New in version 2.2.

get_proposed_credential()
Returns:

A WebKit.Credential encapsulating credential details or None if there is no stored credential.

Return type:

WebKit.Credential

Get the WebKit.Credential of the proposed authentication challenge.

Get the 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 WebKit.Credential.

New in version 2.2.

get_realm()
Returns:

The realm of self.

Return type:

str

Get the realm that this authentication challenge is applicable to.

New in version 2.2.

get_scheme()
Returns:

The WebKit.AuthenticationScheme of self.

Return type:

WebKit.AuthenticationScheme

Get the authentication scheme of the authentication challenge.

New in version 2.2.

get_security_origin()
Returns:

a newly created WebKit.SecurityOrigin.

Return type:

WebKit.SecurityOrigin

Get the WebKit.SecurityOrigin that this authentication challenge is applicable to.

New in version 2.30.

is_for_proxy()
Returns:

True if authentication is for a proxy or False otherwise.

Return type:

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.

New in version 2.2.

is_retry()
Returns:

True if authentication attempt is a retry or False otherwise.

Return type:

bool

Determine whether this this is a first attempt or a retry for this authentication challenge.

New in version 2.2.

set_can_save_credentials(enabled)
Parameters:

enabled (bool) – value to set

Set whether the authentication method associated with self should allow the storage of credentials.

Set whether the authentication method associated with self 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.

New in version 2.30.

set_proposed_credential(credential)
Parameters:

credential (WebKit.Credential) – a WebKit.Credential, or None

Set the WebKit.Credential of the proposed authentication challenge.

Set the 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, WebKit.AuthenticationRequest.get_proposed_credential() already contains previously-stored credentials.) Passing a None credential will clear the proposed credential.

New in version 2.30.

Signal Details

WebKit.AuthenticationRequest.signals.authenticated(authentication_request, credential)
Signal Name:

authenticated

Flags:

RUN_LAST

Parameters:

This signal is emitted when the user authentication request succeeded. Applications handling their own credential storage should connect to this signal to save the credentials.

New in version 2.30.

WebKit.AuthenticationRequest.signals.cancelled(authentication_request)
Signal Name:

cancelled

Flags:

RUN_LAST

Parameters:

authentication_request (WebKit.AuthenticationRequest) – The object which received the signal

This signal is emitted when the user authentication request is cancelled. It allows the application to dismiss its authentication dialog in case of page load failure for example.

New in version 2.2.