static char * digest_auth_cb (SoupAuthDomain * domain, SoupMessage * msg, const char *username, gpointer user_data) { /* There is only one good login for testing */ if (strcmp (username, good_user) == 0) return soup_auth_domain_digest_encode_password (good_user, realm, good_pw); return NULL; }
static char * server_digest_auth_callback (SoupAuthDomain *auth_domain, SoupMessage *msg, const char *username, gpointer data) { if (strcmp (username, "user") != 0) return NULL; return soup_auth_domain_digest_encode_password ("user", "auth-test", "good"); }
static char * digest_auth_callback (SoupAuthDomain *auth_domain, SoupMessage *msg, const char *username, gpointer data) { if (strcmp (username, "user") != 0) return NULL; /* Note: this is exactly how you *shouldn't* do it in the real * world; you should have the pre-encoded password stored in a * database of some sort rather than using the cleartext * password in the callback. */ return soup_auth_domain_digest_encode_password ("user", "server-auth-test", "password"); }