Closed kzjeef closed 10 years ago
I have checked some source code, seems it's failed because some command require auth method, but how to pass the auth method in xml_rpc ?
seems it have a header Authorization.
in below code xmlrpc_http.erl
:
{"Authorization:", Authorization} ->
parse_header(Socket, Timeout,
Header#header{authorization = Authorization});
But any one can explain how to pass the login info ?
Thanks,
Thanks to Vladimir Stafievsky , who answer this question on mail list.
For the record, this issue is fixed by remove the line
access_commands:
configure:
all: []
For permission, use firewall to protect from outside.
How i will activate authetification mod ? knowing that i can register new user from php code using XML RPC but any one can interact my ejabberd server .. how i require using password or some thing like that to register new user ???
this is my code !!
$param=array("user"=>"ok","host"=>"localhost","password"=>"ok"); $request = xmlrpc_encode_request('register', $param, (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://127.0.0.1:4560", false, $context); $response = xmlrpc_decode($file); if (xmlrpc_is_fault($response)) { trigger_error("xmlrpc: $response[faultString] ($response[faultCode])"); } else { print_r($response); }
my config in ejabberd yaml port: 4560 ip: "::" module: ejabberd_xmlrpc maxsessions: 10 timeout: 5000 access_commands:
thank you
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
I'm using 14.07 release with build in xmlrpc module in my application.
Basicly I'm using xmlrpc to register account to jabbered and modify roster list etc things, I can run this code success under Mac with with 14.05. But after I deploy it to ubuntu with 14.07, I'm facing this issue:
For those command failed with 500, I checked the ejabberd log, it shows:
2014-08-19 05:15:47.159 [error] <0.545.0> {xmlrpc_http,171,{ejabberd_xmlrpc,handler,{'EXIT',{{badmatch,no_auth_provided},[{ejabberd_commands,check_access,2,[{file,"src/ejabberd_commands.erl"},{line,402}]},{ejabberd_commands,'-check_access_commands/5-fun-0-',5,[{file,"src/ejabberd_commands.erl"},{line,373}]},{lists,'-filter/2-lc$^0/1-0-',2,[{file,"lists.erl"},{line,1271}]},{ejabberd_commands,check_access_commands,5,[{file,"src/ejabberd_commands.erl"},{line,371}]},{ejabberd_commands,execute_command,4,[{file,"src/ejabberd_commands.erl"},{line,308}]},{ejabberd_xmlrpc,do_command,6,[{file,"src/ejabberd_xmlrpc.erl"},{line,350}]},{ejabberd_xmlrpc,try_do_command,6,[{file,"src/ejabberd_xmlrpc.erl"},{line,313}]},{xmlrpc_http,eval_payload,7,[{file,"src/xmlrpc_http.erl"},{line,166}]}]}}}}
I suspect it will related with the permission configure, but I cannot figure out where.
Paste my configure file:
My test script (test.rb):