Re: SOAP in C# - invalid login
Are you using the LDAP integrated login where you are logging in against a Windows Active Directory account? If so there is a somewhat different process for logging in on that. Following is some info on how you have to get authentication through the LDAP service. Otherwise, it's been awhile since I researched this but if I remember correctly the returned key changes on each login so you'll need to recheck.
$key = 'abc123'; // LDAP Key as entered in Sugar
$key = substr(md5($key),0,24);
$iv = 'password';
$ldap_hash = bin2hex(mcrypt_cbc(MCRYPT_3DES, $key, $user_password, MCRYPT_ENCRYPT, $iv));
$this->client->call('login',array('user_auth'=>array('user_name' =>$user_name, 'password'=>$ldap_hash,'version'=>'.1'), 'application_name'=>$app_name));
From post: http://www.sugarcrm.com/forums/showthread.php?t=23738
This is from the WIKI. I think it's mostly the same as above though I don't have time to go through it.
(http://www.sugarcrm.com/wiki/index.p...P_through_SOAP)
require_once('./path/to/nusoap.php');
$soap_client = new soapclient('http://someurl.com/sugar/soap.php?wsdl');
$user_name = 'matt';
$user_password = 'mygoodsecret123';
$app_name = 'myniceprogram';
$key = 'abc123'; // LDAP Key as entered in Sugar
$key = substr(md5($key),0,24);
$iv = 'password'; // note that this is the word password, not the user's password or hash...
$ldap_hash = bin2hex(mcrypt_cbc(MCRYPT_3DES, $key, $user_password, MCRYPT_ENCRYPT, $iv));
$soap_client->call('login',array('user_auth'=>array('user_name' =>$user_name, 'password'=>$ldap_hash,'version'=>'.1'), 'application_name'=>$app_name))
Jerry Way
Business Process Administrator
Sugar 6.1.4 Professional
(Testing 6.1.2)
LAMP on Centos 5
PHP 5
MySQL 5
Apache 2.2
Bookmarks