Authentication GMP.
More...
#include <glib.h>
Go to the source code of this file.
|
| int | authenticate_gmp (const gchar *, const gchar *, gchar **, gchar **, gchar **, gchar **, gchar **, gchar **) |
| | Check authentication credentials. More...
|
| |
Authentication GMP.
Definition in file gsad_gmp_auth.h.
◆ authenticate_gmp()
| int authenticate_gmp |
( |
const gchar * |
username, |
|
|
const gchar * |
password, |
|
|
gchar ** |
role, |
|
|
gchar ** |
timezone, |
|
|
gchar ** |
severity, |
|
|
gchar ** |
capabilities, |
|
|
gchar ** |
language, |
|
|
gchar ** |
pw_warning |
|
) |
| |
Check authentication credentials.
- Parameters
-
| [in] | username | Username. |
| [in] | password | Password. |
| [out] | role | Role. |
| [out] | timezone | Timezone. |
| [out] | severity | Severity class. |
| [out] | capabilities | Capabilities of manager. |
| [out] | language | User Interface Language, or NULL. |
| [out] | pw_warning | Password warning message, NULL if password is OK. |
- Returns
- 0 if valid, 1 manager down, 2 failed, 3 timeout, -1 error.
Definition at line 17223 of file gsad_gmp.c.
17227 gvm_connection_t connection;
17229 gmp_authenticate_info_opts_t auth_opts;
17233 g_debug (
"%s failed to acquire socket!\n", __FUNCTION__);
17237 auth_opts = gmp_authenticate_info_opts_defaults;
17238 auth_opts.username = username;
17239 auth_opts.password = password;
17240 auth_opts.role = role;
17241 auth_opts.severity = severity;
17242 auth_opts.timezone = timezone;
17243 auth_opts.pw_warning = pw_warning;
17245 auth = gmp_authenticate_info_ext_c (&connection, auth_opts);
17249 const char *status;
17257 &connection,
"6765549a-934e-11e3-b358-406186ea4fc5", language, NULL);
17265 gvm_connection_close (&connection);
17268 gvm_connection_close (&connection);
17274 ret = gvm_connection_sendf (&connection,
17275 "<help format=\"XML\" type=\"brief\"/>");
17278 gvm_connection_close (&connection);
17285 if (read_entity_and_text_c (&connection, &entity, &response))
17287 gvm_connection_close (&connection);
17293 status = entity_attribute (entity,
"status");
17294 if (status == NULL || strlen (status) == 0)
17297 free_entity (entity);
17302 free_entity (entity);
17306 *capabilities = response;
17310 gvm_connection_close (&connection);
17315 gvm_connection_close (&connection);
17320 gvm_connection_close (&connection);
References gvm_connection_open(), manager_address, manager_port, and setting_get_value().
Referenced by login().