Class AuthManager
- All Implemented Interfaces:
SessionFeature, Proxy
HTTP client-side authentication handler.
AuthManager is the SessionFeature that handles HTTP
authentication for a Session.
A AuthManager 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(Type) or disable it on
individual requests with Message.disableFeature(Type).
You can use this with Session.removeFeatureByType(Type) or
Message.disableFeature(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 GObject
GObject.NotifyCallback, GObject.ObjectClassNested classes/interfaces inherited from interface SessionFeature
SessionFeature.SessionFeature$Impl, SessionFeature.SessionFeatureInterface -
Constructor Summary
ConstructorsConstructorDescriptionCreate a new AuthManager.AuthManager(MemorySegment address) Create a AuthManager instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionprotected AuthManagerasParent()Return 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 MemoryLayoutThe memory layout of the native struct.static @Nullable TypegetType()Get the GType of the AuthManager class.voidRecords thatauthis to be used underuri,as though a WWW-Authenticate header had been received at that URI.Methods inherited from class 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, 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 TypeInstance
callParent, callParent, cast, getPrivate, readGClass, writeGClassMethods inherited from class ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
AuthManager
Create a AuthManager instance for the provided memory address.- Parameters:
address- the memory address of the native object
-
AuthManager
public AuthManager()Create a new AuthManager.
-
-
Method Details
-
getType
-
getMemoryLayout
The memory layout of the native struct.- Returns:
- the memory layout
-
asParent
Return this instance as if it were its parent type. Comparable to the Javasuperkeyword, but ensures the parent typeclass is also used in native code. -
clearCachedCredentials
public void clearCachedCredentials()Clear all credentials cached bymanager. -
useAuth
Records that
authis 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
-