Class AuthenticationRequest
- All Implemented Interfaces:
Proxy
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 WebKitWebView::authenticate signal with a
WebKitAuthenticationRequest object to provide client side
authentication support. Credentials are exposed through the
WebKitCredential 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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceFunctional interface declaration of theAuthenticatedCallbackcallback.static classstatic classInner class implementing a builder pattern to construct a GObject with properties.static interfaceFunctional interface declaration of theCancelledCallbackcallback.Nested classes/interfaces inherited from class org.gnome.gobject.GObject
GObject.NotifyCallback, GObject.ObjectClass -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new AuthenticationRequest.AuthenticationRequest(MemorySegment address) Create a AuthenticationRequest proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionprotected AuthenticationRequestasParent()Returns this instance as if it were its parent type.voidauthenticate(@Nullable Credential credential) Authenticate theWebKitAuthenticationRequest.static AuthenticationRequest.Builder<? extends AuthenticationRequest.Builder> builder()AAuthenticationRequest.Builderobject constructs aAuthenticationRequestwith the specified properties.voidcancel()Cancel the authentication challenge.booleanDetermine whether thisWebKitAuthenticationRequestshould allow the storage of credentials.voidemitAuthenticated(@Nullable Credential credential) Emits the "authenticated" signal.voidEmits the "cancelled" signal.Get theGTlsPasswordFlagsof theAuthenticationScheme.CLIENT_CERTIFICATE_PIN_REQUESTEDauthentication challenge.getHost()Get the host that this authentication challenge is applicable to.intgetPort()Get the port that this authentication challenge is applicable to.Get theWebKitCredentialof the proposed authentication challenge.getRealm()Get the realm that this authentication challenge is applicable to.Get the authentication scheme of the authentication challenge.Get theWebKitSecurityOriginthat this authentication challenge is applicable to.static @Nullable TypegetType()Get the GType of the AuthenticationRequest classbooleanDetermine whether the authentication challenge is associated with a proxy server.booleanisRetry()Determine whether this this is a first attempt or a retry for this authentication challenge.This signal is emitted when the user authentication request succeeded.This signal is emitted when the user authentication request is cancelled.voidsetCanSaveCredentials(boolean enabled) Set whether the authentication method associated with this AuthenticationRequest should allow the storage of credentials.voidsetProposedCredential(Credential credential) Set theWebKitCredentialof the proposed authentication challenge.Methods inherited from class org.gnome.gobject.GObject
addToggleRef, addWeakPointer, bindProperty, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, connect, constructed, disconnect, dispatchPropertiesChanged, dispose, dupData, dupQdata, emit, emitNotify, finalize_, forceFloating, freezeNotify, get, getData, getMemoryLayout, getProperty, getProperty, getProperty, getQdata, getv, interfaceFindProperty, interfaceInstallProperty, interfaceListProperties, isFloating, newInstance, newInstance, newv, notify, notify, notifyByPspec, onNotify, ref, refSink, removeToggleRef, removeWeakPointer, replaceData, replaceQdata, runDispose, set, setData, setDataFull, setProperty, setProperty, setProperty, setQdata, setQdataFull, setv, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref, withPropertiesMethods inherited from class org.gnome.gobject.TypeInstance
callParent, callParent, cast, getPrivate, readGClass, writeGClassMethods inherited from class org.javagi.base.ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
AuthenticationRequest
Create a AuthenticationRequest proxy instance for the provided memory address.- Parameters:
address- the memory address of the native object
-
AuthenticationRequest
public AuthenticationRequest()Creates a new AuthenticationRequest.
-
-
Method Details
-
getType
Get the GType of the AuthenticationRequest class- Returns:
- the GType
-
asParent
Returns this instance as if it were its parent type. This is mostly synonymous to the Javasuperkeyword, but will set the native typeclass function pointers to the parent type. When overriding a native virtual method in Java, "chaining up" withsuper.methodName()doesn't work, because it invokes the overridden function pointer again. To chain up, callasParent().methodName(). This will call the native function pointer of this virtual method in the typeclass of the parent type. -
authenticate
Authenticate theWebKitAuthenticationRequest.Authenticate the
WebKitAuthenticationRequestusing theWebKitCredentialsupplied. To continue without credentials, passnullascredential.- Parameters:
credential- AWebKitCredential, ornull- Since:
- 2.2
-
canSaveCredentials
public boolean canSaveCredentials()Determine whether thisWebKitAuthenticationRequestshould allow the storage of credentials.Determine whether the authentication method associated with this
WebKitAuthenticationRequestshould allow the storage of credentials. This will returnfalseif WebKit doesn't support credential storing, if private browsing is enabled, or if persistent credential storage has been disabled inWebKitWebsiteDataManager, unless credentials saving has been explicitly enabled with webkit_authentication_request_set_can_save_credentials().- Returns:
trueif WebKit can store credentials orfalseotherwise.- Since:
- 2.2
-
cancel
public void cancel()Cancel the authentication challenge.This will also cancel the page loading and result in a
WebKitWebView::load-failed signal with aWebKitNetworkErrorof typeNetworkError.CANCELLEDbeing emitted.- Since:
- 2.2
-
getCertificatePinFlags
Get theGTlsPasswordFlagsof theAuthenticationScheme.CLIENT_CERTIFICATE_PIN_REQUESTEDauthentication challenge.- Returns:
- a
GTlsPasswordFlags - Since:
- 2.34
-
getHost
Get the host that this authentication challenge is applicable to.- Returns:
- The host of
request. - Since:
- 2.2
-
getPort
public int getPort()Get the port that this authentication challenge is applicable to.- Returns:
- The port of
request. - Since:
- 2.2
-
getProposedCredential
Get theWebKitCredentialof the proposed authentication challenge.Get the
WebKitCredentialof the proposed authentication challenge that was stored from a previous session. The client can use this directly for authentication or construct their ownWebKitCredential.- Returns:
- A
WebKitCredentialencapsulating credential details ornullif there is no stored credential. - Since:
- 2.2
-
getRealm
Get the realm that this authentication challenge is applicable to.- Returns:
- The realm of
request. - Since:
- 2.2
-
getScheme
Get the authentication scheme of the authentication challenge.- Returns:
- The
WebKitAuthenticationSchemeofrequest. - Since:
- 2.2
-
getSecurityOrigin
Get theWebKitSecurityOriginthat this authentication challenge is applicable to.- Returns:
- a newly created
WebKitSecurityOrigin. - Since:
- 2.30
-
isForProxy
public boolean isForProxy()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.
- Returns:
trueif authentication is for a proxy orfalseotherwise.- Since:
- 2.2
-
isRetry
public boolean isRetry()Determine whether this this is a first attempt or a retry for this authentication challenge.- Returns:
trueif authentication attempt is a retry orfalseotherwise.- Since:
- 2.2
-
setCanSaveCredentials
public void setCanSaveCredentials(boolean enabled) Set whether the authentication method associated with this AuthenticationRequest should allow the storage of credentials.Set whether the authentication method associated with this AuthenticationRequest 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.
- Parameters:
enabled- value to set- Since:
- 2.30
-
setProposedCredential
Set theWebKitCredentialof the proposed authentication challenge.Set the
WebKitCredentialof 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_authentication_request_get_proposed_credential() already contains previously-stored credentials.) Passing anullcredentialwill clear the proposed credential.- Parameters:
credential- aWebKitCredential, ornull- Since:
- 2.30
-
onAuthenticated
public SignalConnection<AuthenticationRequest.AuthenticatedCallback> onAuthenticated(AuthenticationRequest.AuthenticatedCallback handler) 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.- Parameters:
handler- the signal handler- Returns:
- a signal handler ID to keep track of the signal connection
- Since:
- 2.30
- See Also:
-
emitAuthenticated
Emits the "authenticated" signal. SeeonAuthenticated(org.webkitgtk.AuthenticationRequest.AuthenticatedCallback). -
onCancelled
public SignalConnection<AuthenticationRequest.CancelledCallback> onCancelled(AuthenticationRequest.CancelledCallback handler) 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.- Parameters:
handler- the signal handler- Returns:
- a signal handler ID to keep track of the signal connection
- Since:
- 2.2
- See Also:
-
emitCancelled
public void emitCancelled()Emits the "cancelled" signal. SeeonCancelled(org.webkitgtk.AuthenticationRequest.CancelledCallback). -
builder
AAuthenticationRequest.Builderobject constructs aAuthenticationRequestwith the specified properties. Use the variousset...()methods to set properties, and finish construction withAuthenticationRequest.Builder.build().- Returns:
- the builder object
-