Hi Nito,
I am using SugarCRM version 6.5.16 PRO. The user I am using is an
administrator.
I followed your test instructions. I set the $login and $pass. With
$pass='mypassword';
the test is failing with
Error getting id <200 OK> fetching $VAR1 = '{"name":"Invalid
Login","number":10,"description":"Login attempt failed please check the
username and password"}';
Whereas if I set
$pass=md5_hex('mypassword');
It works fine.
The article I found on which shows the logging in process is here:
http://support.sugarcrm.com/04_Find_Answers/03_Developers/100Web_Services/100REST_API/100Examples/100PHP/Logging_In_-_REST_and_PHP
Just been doing some more digging around in the SugarCRM source - in
particular SugarWebServiceImplv4.php - it appears that if you set
encryption => 'PLAIN'
in the user_auth hash - this will tell the server to accept a plaintext
password. I have tried this out (patch attached) and it works. Having
said that I would have thought it would be more secure to send the MD5
password over the wire.
If you need me to create a username and password on our server for you
test, I can do that for a short period - unfortunately being PRO we get
charged for each active login.
All the best,
Damian
On Mon, 2014-03-10 at 01:54 -0400, Nito Martinez via RT wrote:
Show quoted text> <URL:
https://rt.cpan.org/Ticket/Display.html?id=93696 >
>
> Hi Damian,
>
> Not sure what might be happening, I am definitely using the plain version text of the password.
>
> Questions:
>
> - What version of SugarCRM are you using?
> - Are you using an Admin user?
>
> There is a test in t/10-login.t that you can use to try. For that you need to:
>
> a) Set environment var TEST_AUTHOR_SUGAR
> export TEST_AUTHOR_SUGAR=1
>
> b) Define your connection properties in t/lib/defaults.pl, for this case at least the following variables are needed:
>
> $loging
> $pass
> $url
>
> I usually try it by hand with
>
> perl -t -Ilib t/10-login.t
>
> Let me know if these hints helped, and if it something related to a SugarCRM config that I didn't test.
>
> Best Regards,
>
>
>
>
>
> El Lun Mar 10 01:43:03 2014, damo@launtel.net.au escribió:
> > Hi,
> >
> > I found I had to send through the md5_hex version of the password rather
> > than the plain text to allow me to log into my server. I only figured
> > this out by looking at the sugar examples.
> >
> > Not sure if this is a limitation of the documentation (you don't mention
> > it and the tutorial uses an obviously plaintext password) or whether you
> > should be passing the password through md5_hex before sending it to the
> > rest.php stuff.
> >
> > Thanks
> >
> > Damian
> >
>
>
--
Launtel - We're at your call
Tel: 1800LAUNTEL (1800528683)
Mob: 0418217582
Fax: 1300784109
http://www.launtel.net.au