Drizzled Public API Documentation

auth_ldap::AuthLDAP Class Reference

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 Function Documentation

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.

References lookupUser(), and verifyMySQLHash().

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.

Referenced by initialize(), and lookupUser().

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

Retrieve the last error encountered in the class.

Definition at line 198 of file auth_ldap.cc.

Referenced by lookupUser().

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.

References connect().

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.

References connect(), and getError().

Referenced by authenticate().

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.

Referenced by authenticate().


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