Class AuthManager
- All Implemented Interfaces:
SessionFeature,Proxy
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
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classAuthManager.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.ObjectClassNested classes/interfaces inherited from interface org.gnome.soup.SessionFeature
SessionFeature.SessionFeature$Impl, SessionFeature.SessionFeatureInterface -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new AuthManager.AuthManager(MemorySegment address) Create a AuthManager proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionprotected AuthManagerasParent()Returns this instance as if it were its parent type.static AuthManager.Builder<? extends AuthManager.Builder> builder()AAuthManager.Builderobject constructs aAuthManagerwith the specified properties.voidClear all credentials cached bymanager.static @Nullable TypegetType()Get the GType of the AuthManager classvoidRecords thatauthis 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, 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
-
AuthManager
Create a AuthManager proxy instance for the provided memory address.- Parameters:
address- the memory address of the native object
-
AuthManager
public AuthManager()Creates a new AuthManager.
-
-
Method Details
-
getType
-
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. -
clearCachedCredentials
public void clearCachedCredentials()Clear all credentials cached bymanager. -
useAuth
Records thatauthis to be used underuri,as though a WWW-Authenticate header had been received at that URI.This can be used to "preload"
manager'sauth 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- theGUriunder whichauthis to be usedauth- theSoupAuthto use
-
builder
AAuthManager.Builderobject constructs aAuthManagerwith the specified properties. Use the variousset...()methods to set properties, and finish construction withAuthManager.Builder.build().- Returns:
- the builder object
-