2 * Copyright 2007, OpenLDAP Foundation, All Rights Reserved.
3 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
8 #include "LDAPRequest.h"
9 #include "LDAPException.h"
11 #include "LDAPResult.h"
12 #include "LDAPSaslBindResult.h"
16 LDAPSaslBindResult::LDAPSaslBindResult(const LDAPRequest* req, LDAPMessage* msg) :
18 DEBUG(LDAP_DEBUG_CONSTRUCT,"LDAPSaslBindResult::LDAPSaslBindResult()"
21 LDAP* lc = req->getConnection()->getSessionHandle();
22 int err = ldap_parse_sasl_bind_result(lc, msg, &data, 0);
23 if( err != LDAP_SUCCESS && err != LDAP_SASL_BIND_IN_PROGRESS ){
25 throw LDAPException(err);
28 DEBUG(LDAP_DEBUG_TRACE, " creds present" << std::endl);
29 m_creds=string(data->bv_val, data->bv_len);
32 DEBUG(LDAP_DEBUG_TRACE, " no creds present" << std::endl);
37 LDAPSaslBindResult::~LDAPSaslBindResult(){
38 DEBUG(LDAP_DEBUG_DESTROY,"LDAPSaslBindResult::~LDAPSaslBindResult()" << endl);
41 const string& LDAPSaslBindResult::getServerCreds() const{