]>
Commit | Line | Data |
---|---|---|
11fdf7f2 TL |
1 | # Civetweb API Reference |
2 | ||
3 | ### `mg_check_digest_access_authentication( conn, realm, filename );` | |
4 | ||
5 | ### Parameters | |
6 | ||
7 | | Parameter | Type | Description | | |
8 | | :--- | :--- | :--- | | |
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 | | |
12 | ||
13 | ### Return Value | |
14 | ||
15 | | Type | Description | | |
16 | | :--- | :--- | | |
17 | |`int`| An integer indicating success or failure | | |
18 | ||
19 | ### Description | |
20 | ||
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. | |
25 | ||
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, | |
29 | realm and password. | |
30 | The function returns a negative number on errors. | |
31 | ||
32 | ### See Also | |
33 | ||
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) | |
37 |