Trait webkit2gtk::prelude::AuthenticationRequestExt
source · [−]pub trait AuthenticationRequestExt: 'static {
Show 15 methods
fn can_save_credentials(&self) -> bool;
fn cancel(&self);
fn certificate_pin_flags(&self) -> TlsPasswordFlags;
fn host(&self) -> Option<GString>;
fn port(&self) -> u32;
fn proposed_credential(&self) -> Option<Credential>;
fn realm(&self) -> Option<GString>;
fn scheme(&self) -> AuthenticationScheme;
fn security_origin(&self) -> Option<SecurityOrigin>;
fn is_for_proxy(&self) -> bool;
fn is_retry(&self) -> bool;
fn set_can_save_credentials(&self, enabled: bool);
fn set_proposed_credential(&self, credential: &mut Credential);
fn connect_authenticated<F: Fn(&Self, &Credential) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_cancelled<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
}
Expand description
Required Methods
sourcefn can_save_credentials(&self) -> bool
fn can_save_credentials(&self) -> bool
v2_2
only.Determine whether this AuthenticationRequest
should allow the storage of credentials.
Determine whether the authentication method associated with this
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 WebsiteDataManager
, unless credentials saving has been
explicitly enabled with set_can_save_credentials()
.
Returns
sourcefn cancel(&self)
fn cancel(&self)
v2_2
only.Cancel the authentication challenge.
This will also cancel the page loading and result in a
signal::WebView::load-failed
signal with a NetworkError
of type NetworkError::Cancelled
being emitted.
sourcefn certificate_pin_flags(&self) -> TlsPasswordFlags
fn certificate_pin_flags(&self) -> TlsPasswordFlags
v2_34
only.Get the gio::TlsPasswordFlags
of the AuthenticationScheme::ClientCertificatePinRequested
authentication challenge.
Returns
sourcefn proposed_credential(&self) -> Option<Credential>
fn proposed_credential(&self) -> Option<Credential>
v2_2
only.Get the Credential
of the proposed authentication challenge.
Get the 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 Credential
.
Returns
A Credential
encapsulating credential details
or None
if there is no stored credential.
sourcefn scheme(&self) -> AuthenticationScheme
fn scheme(&self) -> AuthenticationScheme
v2_2
only.Get the authentication scheme of the authentication challenge.
Returns
The AuthenticationScheme
of self
.
sourcefn security_origin(&self) -> Option<SecurityOrigin>
fn security_origin(&self) -> Option<SecurityOrigin>
v2_30
only.Get the SecurityOrigin
that this authentication challenge is applicable to.
Returns
a newly created SecurityOrigin
.
sourcefn is_for_proxy(&self) -> bool
fn is_for_proxy(&self) -> bool
v2_2
only.sourcefn set_can_save_credentials(&self, enabled: bool)
fn set_can_save_credentials(&self, enabled: bool)
v2_30
only.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.
enabled
value to set
sourcefn set_proposed_credential(&self, credential: &mut Credential)
fn set_proposed_credential(&self, credential: &mut Credential)
v2_30
only.Set the Credential
of the proposed authentication challenge.
Set the 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,
proposed_credential()
already contains previously-stored
credentials.)
Passing a None
credential
will clear the proposed credential.
credential
a Credential
, or None
sourcefn connect_authenticated<F: Fn(&Self, &Credential) + 'static>(
&self,
f: F
) -> SignalHandlerId
fn connect_authenticated<F: Fn(&Self, &Credential) + 'static>(
&self,
f: F
) -> SignalHandlerId
v2_30
only.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.
credential
the Credential
accepted
sourcefn connect_cancelled<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId
fn connect_cancelled<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId
v2_2
only.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.