drizzle
C++ MySQL-protocol-compatible database server
Loading...
Searching...
No Matches
auth_ldap::AuthLDAP Class Reference
Inheritance diagram for auth_ldap::AuthLDAP:
[legend]
Collaboration diagram for auth_ldap::AuthLDAP:
[legend]

Public Member Functions

 AuthLDAP (string name_arg)
bool initialize (void)
bool connect (void)
string & getError (void)

Private Types

enum  PasswordType { NOT_FOUND , PLAIN_TEXT , MYSQL_HASH }
typedef std::pair< PasswordType, std::string > PasswordEntry
typedef std::pair< std::string, PasswordEntry > UserEntry
typedef std::map< std::string, PasswordEntry > UserCache

Private Member Functions

bool authenticate (const identifier::User &sctx, const string &password)
void lookupUser (const string &user)
bool verifyMySQLHash (const PasswordEntry &password, const string &scramble_bytes, const string &scrambled_password)

Private Attributes

time_t next_cache_expiration
LDAP * ldap
string error
UserCache users
pthread_rwlock_t lock

Detailed Description

Definition at line 60 of file auth_ldap.cc.

Member Typedef Documentation

◆ PasswordEntry

typedef std::pair<PasswordType, std::string> auth_ldap::AuthLDAP::PasswordEntry
private

Definition at line 95 of file auth_ldap.cc.

◆ UserCache

typedef std::map<std::string, PasswordEntry> auth_ldap::AuthLDAP::UserCache
private

Definition at line 97 of file auth_ldap.cc.

◆ UserEntry

typedef std::pair<std::string, PasswordEntry> auth_ldap::AuthLDAP::UserEntry
private

Definition at line 96 of file auth_ldap.cc.

Member Enumeration Documentation

◆ PasswordType

enum auth_ldap::AuthLDAP::PasswordType
private

Definition at line 88 of file auth_ldap.cc.

Constructor & Destructor Documentation

◆ AuthLDAP()

auth_ldap::AuthLDAP::AuthLDAP ( string name_arg)

Definition at line 133 of file auth_ldap.cc.

◆ ~AuthLDAP()

auth_ldap::AuthLDAP::~AuthLDAP ( )

Definition at line 142 of file auth_ldap.cc.

Member Function Documentation

◆ authenticate()

bool auth_ldap::AuthLDAP::authenticate ( const identifier::User & sctx,
const string & password )
private

Base class method to check authentication for a user.

Definition at line 203 of file auth_ldap.cc.

◆ connect()

bool auth_ldap::AuthLDAP::connect ( void )

Connect to the LDAP server.

Returns
True on success, false otherwise.

Definition at line 161 of file auth_ldap.cc.

◆ getError()

string & auth_ldap::AuthLDAP::getError ( void )

Retrieve the last error encountered in the class.

Definition at line 198 of file auth_ldap.cc.

◆ initialize()

bool auth_ldap::AuthLDAP::initialize ( void )

Initialize the LDAP connection.

Returns
True on success, false otherwise.

Definition at line 149 of file auth_ldap.cc.

◆ lookupUser()

void auth_ldap::AuthLDAP::lookupUser ( const string & user)
private

Lookup a user in LDAP.

Parameters
[in]Usernameto lookup.

Definition at line 273 of file auth_ldap.cc.

◆ verifyMySQLHash()

bool auth_ldap::AuthLDAP::verifyMySQLHash ( const PasswordEntry & password,
const string & scramble_bytes,
const string & scrambled_password )
private

Verify the local and remote scrambled password match using the MySQL hashing algorithm.

Parameters
[in]passwordPlain text password that is stored locally.
[in]scramble_bytesThe random bytes that the server sent to the client for scrambling the password.
[in]scrambled_passwordThe result of the client scrambling the password remotely.
Returns
True if the password matched, false if not.

Definition at line 356 of file auth_ldap.cc.

Member Data Documentation

◆ error

string auth_ldap::AuthLDAP::error
private

Definition at line 128 of file auth_ldap.cc.

◆ ldap

LDAP* auth_ldap::AuthLDAP::ldap
private

Definition at line 127 of file auth_ldap.cc.

◆ lock

pthread_rwlock_t auth_ldap::AuthLDAP::lock
private

Definition at line 130 of file auth_ldap.cc.

◆ next_cache_expiration

time_t auth_ldap::AuthLDAP::next_cache_expiration
private

Definition at line 126 of file auth_ldap.cc.

◆ users

UserCache auth_ldap::AuthLDAP::users
private

Definition at line 129 of file auth_ldap.cc.


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