Next: , Up: microhttpd-dauth


9.1 Using Basic Authentication

— Function: char * MHD_basic_auth_get_username_password (struct MHD_Connection *connection, char** password)

Get the username and password from the basic authorization header sent by the client. Return NULL if no username could be found, a pointer to the username if found. If returned value is not NULL, the value must be free()'ed.

password reference a buffer to store the password. It can be NULL. If returned value is not NULL, the value must be free()'ed.

— Function: int MHD_queue_basic_auth_fail_response (struct MHD_Connection *connection, const char *realm, struct MHD_Response *response)

Queues a response to request basic authentication from the client. Return MHD_YES if successful, otherwise MHD_NO.

realm must reference to a zero-terminated string representing the realm.

response a response structure to specify what shall be presented to the client with a 401 HTTP status.