Hello,
I am trying to setup a very simple alert bot for Jabber that would send a message to me when an event happens.
For some reason every single time I try to connect (with valid credentials, I should add) to my Wildfire Enterprise server, I am given this weird “error not-authorized” message. Here is my short perl script:
#!/usr/bin/perl
use Net::Jabber;
use XML::Parser;
use XML::Stream;
use constant SERVER => ‘‘my.jabber.install’’; # Jabber server to connect to
use constant PORT => ‘‘5222’’; # Port to connect to
use constant USER => ‘‘alertbot’’; # user this script connects as
use constant PASSWORD => ‘‘password-for-alertbot’’; # password associated with USER
use constant RESOURCE => ‘‘perl’’;
my $me = USER . “@” . SERVER;
my $connection = Net::Jabber::Client->new();
$connection->Connect( “hostname” => SERVER,
“port” => PORT )
or die “Cannot connect ($!)\n”;
my @result = $connection->AuthSend( “username” => USER,
“password” => PASSWORD,
“resource” => RESOURCE );
if ($result[0] ne “ok”) {
die “Ident/Auth with server failed: $result[0] - $result[1]\n”;
}
my $msg = Net::Jabber::Message->new();
$msg->SetMessage(
“to” => “dan.u@my.jabber.install”,
“body” => “TESTING TESTING”
);
$connection->Send($msg);
Here is what happens when I execute the test code:
- ./index.cgi
Ident/Auth with server failed: error - not-authorized
The exact error message the server returns in $result[0] and $result[1] is “error” and “not-authorized” int he same one.