Trying to get ejabberd_xmlrpc to work with access_commands. We use external auth. While I have success without access_commands, I'd obviously like to tighten this up. So far, when I use access_commands, I keep getting "invalid_account_data" errors.
I have ejabberd 2.1.10 installed. ejabberd_xmlrpc is 1.13.
ejabberd.cfg
{acl, admin, {user, "user", "host"}}.
{access, xmlrpcaccess, [{allow, admin}]}.
...
{listen,
[
{4560, ejabberd_xmlrpc, [{access_commands, [{xmlrpcaccess, all, []}]}]},
...
]}.
...
{auth_method, external}.
{extauth_program, "/etc/ejabberd/extauth.pl"}.
For this test, I'm using PHP (though I've tried Python as well).
<?php
$jabbername = "user";
$server = "host"
$password = "passwd";
$auth = array("user"=>$jabbername,"server"=>$server,"password"=>$password);
$request = xmlrpc_encode_request('connected_users',array($auth), (array('encoding' => 'utf-8')));
$context = stream_context_create(array('http' => array(
'method' => "POST",
'header' => "User-Agent: XMLRPC::Client mod_xmlrpc\r\n" .
"Content-Type: text/xml\r\n" .
"Content-Length: ".strlen($request),
'content' => $request
)));
$file = file_get_contents('http://hostname:4560/RPC2', false, $context);
$response = xmlrpc_decode($file);
if (
xmlrpc_is_fault($response)) {
trigger_error("xmlrpc: $response[faultString] ($response[faultCode])");
} else {
print_r($response);
}
?>
When I run the PHP script, I get:
A problem '{error,invalid_account_data}' occurred executing the command connected_users with arguments []
It seems to be a credentials problem. I've validated that I can authenticate normally using a client (in my case Pidgin), and the user in the script can do admin type things. However, no amount of coaxing can make this work with ejabberd_xmlrpc.
Any suggestions?