MySQL 9.0.0
Source Code Documentation
auth_ldap_sasl_client::Sasl_mechanism_kerberos Class Reference

Class representing GSSAPI/Kerberos mechanism. More...

#include <auth_ldap_sasl_mechanism.h>

Inheritance diagram for auth_ldap_sasl_client::Sasl_mechanism_kerberos:
[legend]

Public Member Functions

 Sasl_mechanism_kerberos ()
 Constructor. More...
 
 ~Sasl_mechanism_kerberos () override=default
 Destructor. More...
 
bool preauthenticate (const char *user, const char *password) override
 Preauthentication step. More...
 
const char * get_ldap_host () override
 Get LDAP host. More...
 
bool get_default_user (std::string &name) override
 Get default user name. More...
 
const sasl_callback_t * get_callbacks () override
 Gets array of SASL callbacks supported by the mechanism. More...
 
bool require_conclude_by_server () override
 GSSAPI authentication must be concluded by MySQL server. More...
 
- Public Member Functions inherited from auth_ldap_sasl_client::Sasl_mechanism
virtual ~Sasl_mechanism ()=default
 Destructor. More...
 
const char * get_mechanism_name ()
 Gets constans string describing mechanism name. More...
 

Private Attributes

std::string m_ldap_server_host
 URL of the LDAP server. More...
 
Kerberos m_kerberos
 Kerberos object used to perform Kerberos operations. More...
 

Static Private Attributes

static const sasl_callback_t callbacks []
 Array of SASL callbacks supported by this mechanism. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from auth_ldap_sasl_client::Sasl_mechanism
static bool create_sasl_mechanism (const char *mechanism_name, Sasl_mechanism *&mechanism)
 SASL mechanism factory function. More...
 
- Static Public Attributes inherited from auth_ldap_sasl_client::Sasl_mechanism
static const char SASL_GSSAPI [] = "GSSAPI"
 GSSAPI string. More...
 
static const char SASL_SCRAM_SHA1 [] = "SCRAM-SHA-1"
 SCRAM-SHA-1 string. More...
 
static const char SASL_SCRAM_SHA256 [] = "SCRAM-SHA-256"
 SCRAM-SHA-256 string. More...
 
- Protected Member Functions inherited from auth_ldap_sasl_client::Sasl_mechanism
 Sasl_mechanism (const char *mechanism_name)
 Constructor. More...
 

Detailed Description

Class representing GSSAPI/Kerberos mechanism.

Constructor & Destructor Documentation

◆ Sasl_mechanism_kerberos()

auth_ldap_sasl_client::Sasl_mechanism_kerberos::Sasl_mechanism_kerberos ( )
inline

Constructor.

◆ ~Sasl_mechanism_kerberos()

auth_ldap_sasl_client::Sasl_mechanism_kerberos::~Sasl_mechanism_kerberos ( )
overridedefault

Destructor.

Member Function Documentation

◆ get_callbacks()

const sasl_callback_t * auth_ldap_sasl_client::Sasl_mechanism_kerberos::get_callbacks ( )
inlineoverridevirtual

Gets array of SASL callbacks supported by the mechanism.

Returns
array of callbacks

Reimplemented from auth_ldap_sasl_client::Sasl_mechanism.

◆ get_default_user()

bool auth_ldap_sasl_client::Sasl_mechanism_kerberos::get_default_user ( std::string &  name)
overridevirtual

Get default user name.

Called if no user name was provided as parameter to the client. The name is the default principal.

Parameters
name[out] default user name
Return values
truesuccess
falsefailure

Reimplemented from auth_ldap_sasl_client::Sasl_mechanism.

◆ get_ldap_host()

const char * auth_ldap_sasl_client::Sasl_mechanism_kerberos::get_ldap_host ( )
overridevirtual

Get LDAP host.

Returns
LDAP host URL or nullptr on failure

Reimplemented from auth_ldap_sasl_client::Sasl_mechanism.

◆ preauthenticate()

bool auth_ldap_sasl_client::Sasl_mechanism_kerberos::preauthenticate ( const char *  user,
const char *  password 
)
overridevirtual

Preauthentication step.

Obtains Kerberos ticket.

Parameters
user[in] user mname
password[in] user password
Return values
truesuccess
falsefailure

Reimplemented from auth_ldap_sasl_client::Sasl_mechanism.

◆ require_conclude_by_server()

bool auth_ldap_sasl_client::Sasl_mechanism_kerberos::require_conclude_by_server ( )
inlineoverridevirtual

GSSAPI authentication must be concluded by MySQL server.

Returns
true

Reimplemented from auth_ldap_sasl_client::Sasl_mechanism.

Member Data Documentation

◆ callbacks

const sasl_callback_t auth_ldap_sasl_client::Sasl_mechanism_kerberos::callbacks
staticprivate
Initial value:
= {
{SASL_CB_ECHOPROMPT, nullptr, nullptr},
{SASL_CB_NOECHOPROMPT, nullptr, nullptr},
{SASL_CB_LIST_END, nullptr, nullptr}}

Array of SASL callbacks supported by this mechanism.

◆ m_kerberos

Kerberos auth_ldap_sasl_client::Sasl_mechanism_kerberos::m_kerberos
private

Kerberos object used to perform Kerberos operations.

◆ m_ldap_server_host

std::string auth_ldap_sasl_client::Sasl_mechanism_kerberos::m_ldap_server_host
private

URL of the LDAP server.


The documentation for this class was generated from the following files: