Seeking advice on use of CiviCRM::Client::REST, pls.

I went into the module itself and added debug statements to dump the url's posted to, to STDERR.

I'm told by those on the #civicrm irc channel that the API uses the field names provided by the database tables as keys in its methods. I've checked the drpl_users table and in fact the keys in my login method's arguments do in fact match those field names from the table.

When I harvest the url from output, and run that in a browser, it gets me to an access denied page, with a login form. Using these credentials on that login form gets me to the civiCRM menu page, suggesting to me that the url is at least reasonably well formed.

There are several other tests coded and failing at this point, but they are all expected to (and in fact do) fail unless the ->login() method succeeds. Any and all ideas for how to move past this issue would be appreciated.

Thanks,
-- Hugh

#!/usr/bin/perl use strict; use warnings; use CiviCRM::Client; use Data::Dumper; my $civicrm = CiviCRM::Client::REST->new( 'http://example.org', '37736c686aeGrt54skk705bfa9a9Hgsfll81'); print STDERR Dumper($civicrm); if($civicrm->login({ 'name' => 'hesco', 'pass' => 'secret' })){ print STDERR "succeeded in login attempt \n"; } else { print STDERR "failed to login \n"; }
gives me this output:

$VAR1 = bless( { '_civicrmUrl' => 'http://example.org', '_ua' => bless( { 'max_redirect' => 7, 'protocols_forbidden' => undef, 'show_progress' => undef, 'handlers' => { 'response_header' = +> bless( [ + { + 'owner' => 'LWP::UserAgent::parse_head', + 'callback' => sub { "DUMMY" }, + 'm_media_type' => 'html', + 'line' => '/usr/local/share/perl/5.10.0/LWP/UserAgent.pm +:608' + } + ], 'HTTP::Config' ) }, 'no_proxy' => [], 'protocols_allowed' => undef, 'use_eval' => 1, 'requests_redirectable' => [ 'GET', 'HEAD' ], 'timeout' => 180, 'def_headers' => bless( { 'user-age +nt' => 'libwww-perl/5.830' }, 'HTTP::H +eaders' ), 'proxy' => {}, 'max_size' => undef }, 'LWP::UserAgent' ), '_sessionKeyName' => 'key', '_siteKey' => '37736c686aeGrt54skk705bfa9a9Hgsfll81' }, 'CiviCRM::Client::REST' ); failed to login
if( $lal && $lol ) { $life++; }
if( $insurance->rationing() ) { $people->die(); }

In reply to Help, pls, w/ CiviCRM::Client::REST->login() failures . . . by hesco

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.