WebKit2.AuthenticationRequest

g GObject.Object GObject.Object WebKit2.AuthenticationRequest WebKit2.AuthenticationRequest GObject.Object->WebKit2.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)

Name

Type

Access

Description

parent

GObject.Object

r

Class Details

class WebKit2.AuthenticationRequest(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

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

authenticate(credential)
Parameters:

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

Authenticate the WebKit2.AuthenticationRequest.

Authenticate the WebKit2.AuthenticationRequest using the WebKit2.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 WebKit2.AuthenticationRequest should allow the storage of credentials.

Determine whether the authentication method associated with this WebKit2.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 WebKit2.WebsiteDataManager, unless credentials saving has been explicitly enabled with WebKit2.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 WebKit2.WebView ::load-failed signal with a WebKit2.NetworkError of type WebKit2.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 WebKit2.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 WebKit2.Credential encapsulating credential details or None if there is no stored credential.

Return type:

WebKit2.Credential

Get the WebKit2.Credential of the proposed authentication challenge.

Get the WebKit2.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 WebKit2.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 WebKit2.AuthenticationScheme of self.

Return type:

WebKit2.AuthenticationScheme

Get the authentication scheme of the authentication challenge.

New in version 2.2.

get_security_origin()
Returns:

a newly created WebKit2.SecurityOrigin.

Return type:

WebKit2.SecurityOrigin

Get the WebKit2.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 (WebKit2.Credential) – a WebKit2.Credential, or None

Set the WebKit2.Credential of the proposed authentication challenge.

Set the WebKit2.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, WebKit2.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

WebKit2.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.

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

cancelled

Flags:

RUN_LAST

Parameters:

authentication_request (WebKit2.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.