Class AuthManager
- All Implemented Interfaces:
Proxy
,SessionFeature
SoupAuthManager
is the SessionFeature
that handles HTTP
authentication for a Session
.
A SoupAuthManager
is added to the session by default, and normally
you don't need to worry about it at all. However, if you want to
disable HTTP authentication, you can remove the feature from the
session with Session.removeFeatureByType(org.gnome.glib.Type)
or disable it on
individual requests with Message.disableFeature(org.gnome.glib.Type)
.
You can use this with Session.removeFeatureByType(org.gnome.glib.Type)
or
Message.disableFeature(org.gnome.glib.Type)
.
(Although this type has only been publicly visible since libsoup 2.42, it has
always existed in the background, and you can use g_type_from_name
("SoupAuthManager")
to get its GObject.Type
in earlier releases.)
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static class
AuthManager.Builder<B extends AuthManager.Builder<B>>
Inner class implementing a builder pattern to construct a GObject with properties.Nested classes/interfaces inherited from class org.gnome.gobject.GObject
GObject.NotifyCallback, GObject.ObjectClass
Nested classes/interfaces inherited from interface org.gnome.soup.SessionFeature
SessionFeature.SessionFeatureImpl, SessionFeature.SessionFeatureInterface
-
Constructor Summary
ConstructorDescriptionAuthManager
(MemorySegment address) Create a AuthManager proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionprotected AuthManager
asParent()
Returns this instance as if it were its parent type.static AuthManager.Builder
<? extends AuthManager.Builder> builder()
AAuthManager.Builder
object constructs aAuthManager
with the specified properties.void
Clear all credentials cached by this AuthManager.static Type
getType()
Get the GType of the AuthManager classvoid
Records thatauth
is to be used underuri
, as though a WWW-Authenticate header had been received at that URI.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, 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, withProperties
Methods inherited from class org.gnome.gobject.TypeInstance
callParent, callParent, getPrivate, readGClass, writeGClass
Methods inherited from class io.github.jwharm.javagi.base.ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
AuthManager
Create a AuthManager proxy instance for the provided memory address.- Parameters:
address
- the memory address of the native object
-
-
Method Details
-
getType
-
asParent
Returns this instance as if it were its parent type. This is mostly synonymous to the Javasuper
keyword, 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. -
clearCachedCredentials
public void clearCachedCredentials()Clear all credentials cached by this AuthManager. -
useAuth
Records thatauth
is to be used underuri
, as though a WWW-Authenticate header had been received at that URI.This can be used to "preload" this AuthManager's auth cache, to avoid an extra HTTP round trip in the case where you know ahead of time that a 401 response will be returned.
This is only useful for authentication types where the initial Authorization header does not depend on any additional information from the server. (Eg, Basic or NTLM, but not Digest.)
- Parameters:
uri
- theGUri
under whichauth
is to be usedauth
- theSoupAuth
to use
-
builder
AAuthManager.Builder
object constructs aAuthManager
with the specified properties. Use the variousset...()
methods to set properties, and finish construction withAuthManager.Builder.build()
.
-