I have one problem with LDAP authentication .
My script is:
#!/usr/bin/perl
use 5.010;
use strict;
use warnings;
use JSON::RPC::Client;
use Data:
umper;
# Authenticate yourself
my $client = new JSON::RPC::Client;
my $url = 'https://xxxxxxxx/api_jsonrpc.php';
my $authID;
my $response;
my $json = {
jsonrpc => "2.0",
method => "user.login",
params => {
user => "cn=zabbixusr,cn=Users,dc=domain,dc=com" ,
password => "xxxxxxxxxxxxx"
},
id => 1
};
$response = $client->call($url, $json);
# Check if response was successful
die "Authentication failed\n" unless $response->content->{'result'};
$authID = $response->content->{'result'};
print "Authentication successful. Auth ID: " . $authID . "\n";
response is:
Can't call method "content" on an undefined value at authPRD.pl line 27.
WHYYYYYY? :-(
My script is:
#!/usr/bin/perl
use 5.010;
use strict;
use warnings;
use JSON::RPC::Client;
use Data:
umper;# Authenticate yourself
my $client = new JSON::RPC::Client;
my $url = 'https://xxxxxxxx/api_jsonrpc.php';
my $authID;
my $response;
my $json = {
jsonrpc => "2.0",
method => "user.login",
params => {
user => "cn=zabbixusr,cn=Users,dc=domain,dc=com" ,
password => "xxxxxxxxxxxxx"
},
id => 1
};
$response = $client->call($url, $json);
# Check if response was successful
die "Authentication failed\n" unless $response->content->{'result'};
$authID = $response->content->{'result'};
print "Authentication successful. Auth ID: " . $authID . "\n";
response is:
Can't call method "content" on an undefined value at authPRD.pl line 27.
WHYYYYYY? :-(
Comment