3 * Copyright 2007-2014 The OpenLDAP Foundation, All Rights Reserved.
4 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
9 #include "LDAPRequest.h"
10 #include "LDAPException.h"
12 #include "LDAPResult.h"
13 #include "LDAPSaslBindResult.h"
17 LDAPSaslBindResult::LDAPSaslBindResult(const LDAPRequest* req, LDAPMessage* msg) :
19 DEBUG(LDAP_DEBUG_CONSTRUCT,"LDAPSaslBindResult::LDAPSaslBindResult()"
22 LDAP* lc = req->getConnection()->getSessionHandle();
23 int err = ldap_parse_sasl_bind_result(lc, msg, &data, 0);
24 if( err != LDAP_SUCCESS && err != LDAP_SASL_BIND_IN_PROGRESS ){
26 throw LDAPException(err);
29 DEBUG(LDAP_DEBUG_TRACE, " creds present" << std::endl);
30 m_creds=string(data->bv_val, data->bv_len);
33 DEBUG(LDAP_DEBUG_TRACE, " no creds present" << std::endl);
38 LDAPSaslBindResult::~LDAPSaslBindResult(){
39 DEBUG(LDAP_DEBUG_DESTROY,"LDAPSaslBindResult::~LDAPSaslBindResult()" << endl);
42 const string& LDAPSaslBindResult::getServerCreds() const{