AuthDomain

A #SoupAuthDomain manages authentication for all or part of a #SoupServer. To make a server require authentication, first create an appropriate subclass of #SoupAuthDomain, and then add it to the server with soup_server_add_auth_domain().

In order for an auth domain to have any effect, you must add one or more paths to it (via soup_auth_domain_add_path() or the %SOUP_AUTH_DOMAIN_ADD_PATH property). To require authentication for all ordinary requests, add the path "/". (Note that this does not include the special "*" URI (eg, "OPTIONS *"), which must be added as a separate path if you want to cover it.)

If you need greater control over which requests should and shouldn't be authenticated, add paths covering everything you <emphasis>might</emphasis> want authenticated, and then use a filter (soup_auth_domain_set_filter()) to bypass authentication for those requests that don't need it.

Constructors

this
this(SoupAuthDomain* soupAuthDomain, bool ownedRef)

Sets our main struct and passes it to the parent class.

Members

Functions

accepts
string accepts(Message msg)

Checks if @msg contains appropriate authorization for @domain to accept it. Mirroring soup_auth_domain_covers(), this does not check whether or not @domain <emphasis>cares</emphasis> if @msg is authorized.

addPath
void addPath(string path)

Adds @path to @domain, such that requests under @path on @domain's server will require authentication (unless overridden by soup_auth_domain_remove_path() or soup_auth_domain_set_filter()).

challenge
void challenge(Message msg)

Adds a "WWW-Authenticate" or "Proxy-Authenticate" header to @msg, requesting that the client authenticate, and sets @msg's status accordingly.

checkPassword
bool checkPassword(Message msg, string username, string password)

Checks if @msg authenticates to @domain via @username and @password. This would normally be called from a #SoupAuthDomainGenericAuthCallback.

covers
bool covers(Message msg)

Checks if @domain requires @msg to be authenticated (according to its paths and filter function). This does not actually look at whether @msg <emphasis>is</emphasis> authenticated, merely whether or not it needs to be.

getAuthDomainStruct
SoupAuthDomain* getAuthDomainStruct(bool transferOwnership)

Get the main Gtk struct

getRealm
string getRealm()

Gets the realm name associated with @domain

getStruct
void* getStruct()

the main Gtk struct as a void*

removePath
void removePath(string path)

Removes @path from @domain, such that requests under @path on @domain's server will NOT require authentication.

setFilter
void setFilter(SoupAuthDomainFilter filter, void* filterData, GDestroyNotify dnotify)

Adds @filter as an authentication filter to @domain. The filter gets a chance to bypass authentication for certain requests that would otherwise require it. Eg, it might check the message's path in some way that is too complicated to do via the other methods, or it might check the message's method, and allow GETs but not PUTs.

setGenericAuthCallback
void setGenericAuthCallback(SoupAuthDomainGenericAuthCallback authCallback, void* authData, GDestroyNotify dnotify)

Sets @auth_callback as an authentication-handling callback for @domain. Whenever a request comes in to @domain which cannot be authenticated via a domain-specific auth callback (eg, #SoupAuthDomainDigestAuthCallback), the generic auth callback will be invoked. See #SoupAuthDomainGenericAuthCallback for information on what the callback should do.

tryGenericAuthCallback
bool tryGenericAuthCallback(Message msg, string username)

Static functions

getType
GType getType()

Variables

soupAuthDomain
SoupAuthDomain* soupAuthDomain;

the main Gtk struct

Meta