24#ifndef AUTH_LDAP_KERBEROS_H_
25#define AUTH_LDAP_KERBEROS_H_
197 void log(
int error_code);
Kerberos class is built around kerberos library.
Definition: auth_ldap_kerberos.h:58
krb5_context m_context
Kerberos context.
Definition: auth_ldap_kerberos.h:181
void get_ldap_host(std::string &host)
This function gets LDAP host from krb5.conf file.
Definition: auth_ldap_kerberos.cc:43
~Kerberos()
Destructor.
Definition: auth_ldap_kerberos.cc:41
std::string m_realm
user realm
Definition: auth_ldap_kerberos.h:175
void set_user_and_password(const char *user, const char *password)
Set user, realm and password member variables.
Definition: auth_ldap_kerberos.cc:88
void cleanup()
This function frees kerberos context, credentials, credentials cache and user principal.
Definition: auth_ldap_kerberos.cc:72
Krb5_interface krb5
interface to kerberos functions
Definition: auth_ldap_kerberos.h:189
bool get_kerberos_config()
This method gets kerberos profile settings from krb5.conf file.
Definition: auth_ldap_kerberos.cc:295
bool open_default_cache()
Opens default Kerberos cache.
Definition: auth_ldap_kerberos.cc:98
bool obtain_store_credentials()
Definition: auth_ldap_kerberos.cc:123
krb5_ccache m_krb_credentials_cache
Kerberos cache.
Definition: auth_ldap_kerberos.h:183
void destroy_credentials()
Destroys existing credentials (remove them from the cache).
Definition: auth_ldap_kerberos.cc:449
std::string m_user
user name
Definition: auth_ldap_kerberos.h:171
void get_ldap_server_from_kdc()
Gets LDAP server name from krb5.conf file, realms section, kdc option.
Definition: auth_ldap_kerberos.cc:259
std::string m_ldap_server_host
LDAP host.
Definition: auth_ldap_kerberos.h:177
std::string m_password
user password
Definition: auth_ldap_kerberos.h:173
bool m_destroy_tgt
shall be the credentials destroyed on cleanup
Definition: auth_ldap_kerberos.h:179
Kerberos()
Constructor.
Definition: auth_ldap_kerberos.cc:32
void close_default_cache()
Closes default Kerberos cache.
Definition: auth_ldap_kerberos.cc:112
bool credentials_valid()
Check if the cache contains valid credentials.
Definition: auth_ldap_kerberos.cc:371
bool get_default_principal_name(std::string &name)
This function retrieves default principle from kerberos configuration and parses the user name from i...
Definition: auth_ldap_kerberos.cc:462
bool m_initialized
is the object initialized
Definition: auth_ldap_kerberos.h:169
void log(int error_code)
Log a Kerberos error, the message is taken from the Kerberos based on the error code.
Definition: auth_ldap_kerberos.cc:511
bool initialize()
This function creates kerberos context, initializes credentials cache and user principal.
Definition: auth_ldap_kerberos.cc:48
bool m_credentials_created
were the credentials created by the object
Definition: auth_ldap_kerberos.h:187
krb5_creds m_credentials
Kerberos credentials.
Definition: auth_ldap_kerberos.h:185
Class representing interface to KRB5 functions.
Definition: krb5_interface.h:141
static char * password
Definition: mysql_secure_installation.cc:58
char * user
Definition: mysqladmin.cc:66
const char * host
Definition: mysqladmin.cc:65
Definition: auth_ldap_kerberos.cc:30
case opt name
Definition: sslopt-case.h:29