Top | ![]() |
![]() |
![]() |
![]() |
SoupAuthDomainBasic handles the server side of HTTP "Basic" (ie, cleartext password) authentication.
SoupAuthDomain * soup_auth_domain_basic_new (const char *optname1
,...
);
Creates a SoupAuthDomainBasic. You must set the SoupAuthDomain:realm property, to indicate the realm name to be returned with the authentication challenge to the client. Other parameters are optional.
gboolean (*SoupAuthDomainBasicAuthCallback) (SoupAuthDomain *domain
,SoupServerMessage *msg
,const char *username
,const char *password
,gpointer user_data
);
Callback used by SoupAuthDomainBasic for authentication purposes.
The application should verify that username
and password
and valid
and return TRUE
or FALSE
.
If you are maintaining your own password database (rather than using the password to authenticate against some other system like PAM or a remote server), you should make sure you know what you are doing. In particular, don't store cleartext passwords, or easily-computed hashes of cleartext passwords, even if you don't care that much about the security of your server, because users will frequently use the same password for multiple sites, and so compromising any site with a cleartext (or easily-cracked) password database may give attackers access to other more-interesting sites as well.
domain |
the domain. |
[type SoupAuthDomainBasic] |
msg |
the message being authenticated |
|
username |
the username provided by the client |
|
password |
the password provided by the client |
|
user_data |
the data passed to |
void soup_auth_domain_basic_set_auth_callback (SoupAuthDomain *domain
,SoupAuthDomainBasicAuthCallback callback
,gpointer user_data
,GDestroyNotify dnotify
);
Sets the callback that domain
will use to authenticate incoming
requests. For each request containing authorization, domain
will
invoke the callback, and then either accept or reject the request
based on callback
's return value.
You can also set the auth callback by setting the SoupAuthDomainBasic:auth-callback and SoupAuthDomainBasic:auth-data properties, which can also be used to set the callback at construct time.
typedef struct _SoupAuthDomainBasic SoupAuthDomainBasic;
Subclass of SoupAuthDomain for Basic authentication.
“auth-callback”
property“auth-callback” gpointer
The SoupAuthDomainBasicAuthCallback
[type SoupAuthDomainBasicAuthCallback]
Owner: SoupAuthDomainBasic
Flags: Read / Write
“auth-data”
property“auth-data” gpointer
The data to pass to the SoupAuthDomainBasicAuthCallback
Owner: SoupAuthDomainBasic
Flags: Read / Write