gi-soup-3.0.2: Libsoup bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.Soup.Objects.AuthManager

Description

HTTP client-side authentication handler.

AuthManager is the [ifacesessionFeature] that handles HTTP authentication for a [classsession].

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 [methodsession.remove_feature_by_type] or disable it on individual requests with [methodmessage.disable_feature].

You can use this with [methodsession.remove_feature_by_type] or [methodmessage.disable_feature].

(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 [aliasgLib.Type] in earlier releases.)

Synopsis

Exported types

newtype AuthManager Source #

Memory-managed wrapper type.

Constructors

AuthManager (ManagedPtr AuthManager) 

Instances

Instances details
Eq AuthManager Source # 
Instance details

Defined in GI.Soup.Objects.AuthManager

GObject AuthManager Source # 
Instance details

Defined in GI.Soup.Objects.AuthManager

ManagedPtrNewtype AuthManager Source # 
Instance details

Defined in GI.Soup.Objects.AuthManager

Methods

toManagedPtr :: AuthManager -> ManagedPtr AuthManager

TypedObject AuthManager Source # 
Instance details

Defined in GI.Soup.Objects.AuthManager

Methods

glibType :: IO GType

HasParentTypes AuthManager Source # 
Instance details

Defined in GI.Soup.Objects.AuthManager

IsGValue (Maybe AuthManager) Source #

Convert AuthManager to and from GValue. See toGValue and fromGValue.

Instance details

Defined in GI.Soup.Objects.AuthManager

Methods

gvalueGType_ :: IO GType

gvalueSet_ :: Ptr GValue -> Maybe AuthManager -> IO ()

gvalueGet_ :: Ptr GValue -> IO (Maybe AuthManager)

type ParentTypes AuthManager Source # 
Instance details

Defined in GI.Soup.Objects.AuthManager

type ParentTypes AuthManager = '[Object, SessionFeature]

class (GObject o, IsDescendantOf AuthManager o) => IsAuthManager o Source #

Type class for types which can be safely cast to AuthManager, for instance with toAuthManager.

Instances

Instances details
(GObject o, IsDescendantOf AuthManager o) => IsAuthManager o Source # 
Instance details

Defined in GI.Soup.Objects.AuthManager

toAuthManager :: (MonadIO m, IsAuthManager o) => o -> m AuthManager Source #

Cast to AuthManager, for types for which this is known to be safe. For general casts, use castTo.

Methods

clearCachedCredentials

authManagerClearCachedCredentials Source #

Arguments

:: (HasCallStack, MonadIO m, IsAuthManager a) 
=> a

manager: a AuthManager

-> m () 

Clear all credentials cached by manager.

useAuth

authManagerUseAuth Source #

Arguments

:: (HasCallStack, MonadIO m, IsAuthManager a, IsAuth b) 
=> a

manager: a AuthManager

-> Uri

uri: the Uri under which auth is to be used

-> b

auth: the Auth to use

-> m () 

Records that auth is to be used under uri, as though a WWW-Authenticate header had been received at that URI.

This can be used to "preload" manager'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.)