1 # Civetweb API Reference
3 ### `mg_check_digest_access_authentication( conn, realm, filename );`
7 | Parameter | Type | Description |
9 |**`conn`**|`struct mg_connection *`| A pointer to the connection to be used to send data |
10 |**`realm`**|`const char *`| The requested authentication realm or NULL |
11 |**`filename`**|`const char *`| The path to the passwords file |
15 | Type | Description |
17 |`int`| An integer indicating success or failure |
21 This function can be used to check if a request header contains HTTP digest authentication
22 information, matching user and password encoded within the password file.
23 If the authentication realm (also called authentication domain) is NULL, the parameter
24 `authentication_domain` as specified in the server configuration (`mg_start()`) is used.
26 A positive return value means, the user name, realm and a correct password hash have been
27 found in the passwords file.
28 A return of 0 means, reading the password file succeeded, but there was no matching user,
30 The function returns a negative number on errors.
34 * [`mg_send_digest_access_authentication_request();`](mg_send_digest_access_authentication_request.md)
35 * [`mg_modify_passwords_file();`](mg_modify_passwords_file.md)
36 * [`mg_start();`](mg_start.md)