mirror of
https://git.openldap.org/openldap/openldap.git
synced 2024-12-21 03:10:25 +08:00
SASL support for LDAPConnection
This commit is contained in:
parent
8cb162ef44
commit
ee846c174c
@ -60,6 +60,40 @@ void LDAPConnection::bind(const string& dn, const string& passwd,
|
||||
delete msg; // memcheck
|
||||
}
|
||||
|
||||
void LDAPConnection::saslInteractiveBind( const std::string &mech,
|
||||
int flags,
|
||||
SaslInteractionHandler *sih,
|
||||
const LDAPConstraints *cons)
|
||||
{
|
||||
DEBUG(LDAP_DEBUG_TRACE,"LDAPConnection::bind" << endl);
|
||||
LDAPMessageQueue* msg=0;
|
||||
LDAPResult* res=0;
|
||||
try{
|
||||
msg = LDAPAsynConnection::saslInteractiveBind(mech, flags, sih, cons);
|
||||
res = (LDAPResult*)msg->getNext();
|
||||
}catch(LDAPException e){
|
||||
delete msg;
|
||||
delete res;
|
||||
throw;
|
||||
}
|
||||
int resCode=res->getResultCode();
|
||||
if(resCode != LDAPResult::SUCCESS) {
|
||||
if(resCode == LDAPResult::REFERRAL){
|
||||
LDAPUrlList urls = res->getReferralUrls();
|
||||
delete res;
|
||||
delete msg;
|
||||
throw LDAPReferralException(urls);
|
||||
}else{
|
||||
string srvMsg = res->getErrMsg();
|
||||
delete res;
|
||||
delete msg;
|
||||
throw LDAPException(resCode, srvMsg);
|
||||
}
|
||||
}
|
||||
delete res;
|
||||
delete msg;
|
||||
}
|
||||
|
||||
void LDAPConnection::unbind(){
|
||||
LDAPAsynConnection::unbind();
|
||||
}
|
||||
|
@ -89,6 +89,10 @@ class LDAPConnection : private LDAPAsynConnection {
|
||||
*/
|
||||
void bind(const std::string& dn="", const std::string& passwd="",
|
||||
LDAPConstraints* cons=0);
|
||||
void saslInteractiveBind(const std::string& mech,
|
||||
int flags=0,
|
||||
SaslInteractionHandler *sih=0,
|
||||
const LDAPConstraints *cons=0);
|
||||
|
||||
/**
|
||||
* Performs the UNBIND-operation on the destination server
|
||||
|
Loading…
Reference in New Issue
Block a user