-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathauthenticate.h
More file actions
26 lines (23 loc) · 1.04 KB
/
Copy pathauthenticate.h
File metadata and controls
26 lines (23 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#ifndef AUTHENTICATE_H
#define AUTHENTICATE_H
// LDAPHOST is the address of the LDAP server used for authentication.
// Update this value to match the LDAP server's address.
#define LDAP_HOST "ldap://URL:PORT"
// The sizes of the char arrays used to store configuration values.
# ifndef SIMPLE_CHAR_SIZE
# define SIMPLE_CHAR_SIZE 256
# endif
/**
* @brief Authenticate a user against the LDAP server.
*
* This function uses the `ldapwhoami` command to authenticate a user against the LDAP server.
* If the server recognizes the user and password, the user is considered authenticated.
*
* @param username The username of the user to authenticate.
* @param interactive Set to 1 to enable interactive input for LDAP password; 0 for non-interactive mode.
* @param password_stored The password of the user to authenticate. This parameter is only used in non-interactive mode.
*
* @return 0 upon successful authentication; 1 in case of authentication failure.
*/
int authenticate_LDAP_user(char* username, int interactive, char password_stored[256]);
#endif