我尝试使用ejabberd删除用户但我收到了400 /修改了错误请求错误。据我所知,Smack发送的节符合规范[1];它也适用于OpenFire。
Ejabberd在rroemhild / docker-ejabberd docker容器版本17.03-1中运行(最新可用;原因我没有使用processone容器参见[2])配置文件是从那里库存(删除部分;完整复制在[3])
hosts:
- "xmppserver.com"
auth_method:
- internal
acl:
admin:
user:
- "admin": "xmppserver.com"
- "adminaccount": "xmppserver.com"
local:
user_regexp: ""
access:
(nothing of interest here)
modules:
mod_adhoc: {}
host_config:
"xmppserver.com":
domain_certfile: "/opt/ejabberd/ssl/xmppserver.com.pem"
(是的,一旦我确认它适用于我,我将正确配置SSL)
首先,我确认用户有权发出管理员命令:
SENT
<iq to='xmppserver.com' id='Ghtu9-15' type='get'>
<query xmlns='http://jabber.org/protocol/disco#items' node='http://jabber.org/protocol/commands'/>
</iq>
RECEIVED
<iq xml:lang='en' to='appserver@xmppserver.com/39058022031067483561501494598609310' from='xmppserver.com' type='result' id='Ghtu9-15'>
<query node='http://jabber.org/protocol/commands' xmlns='http://jabber.org/protocol/disco#items'>
...
<item node='http://jabber.org/protocol/admin#add-user' name='Add User' jid='xmppserver.com'/>
<item node='http://jabber.org/protocol/admin#delete-user' name='Delete User' jid='xmppserver.com'/>
...
</query>
</iq>
如您所见,delete-user命令列为可用。然后我继续删除用户:
SENT
<iq to='xmppserver.com' id='2vM3f-17' type='set'>
<command xmlns='http://jabber.org/protocol/commands' action='execute' node='http://jabber.org/protocol/admin#delete-user'></command>
</iq>
RECEIVED
<iq xml:lang='en' to='adminaccount@xmppserver.com/163923254889085958281501260654263394' from='xmppserver.com' type='result' id='2vM3f-17'>
<command status='executing' sessionid='2017-07-28T16:51:12.784282Z' node='http://jabber.org/protocol/admin#delete-user' xmlns='http://jabber.org/protocol/commands'>
<actions execute='complete'>
<complete/>
</actions>
<x type='form' xmlns='jabber:x:data'>
<title>Delete User</title>
<field var='FORM_TYPE' type='hidden'>
<value>http://jabber.org/protocol/admin</value>
</field>
<field var='accountjids' type='jid-multi' label='Jabber ID'>
<required/>
</field>
</x>
</command>
</iq>
我不确定&lt; actions ...&gt;标签是关于;它在XEP-133中没有提到。除此之外,表格看起来还不错。
SENT
<iq to='xmppserver.com' id='2vM3f-19' type='set'>
<command xmlns='http://jabber.org/protocol/commands' sessionid='2017-07-28T16:51:12.784282Z' node='http://jabber.org/protocol/admin#delete-user'>
<x xmlns='jabber:x:data' type='submit'>
<field var='FORM_TYPE' type='hidden'>
<value>http://jabber.org/protocol/admin</value>
</field>
<field var='accountjids' type='jid-multi'>
<value>jid@xmppserver.com</value>
</field>
</x>
</command>
</iq>
RECEIVED
<iq xml:lang='en' to='adminaccount@xmppserver.com/163923254889085958281501260654263394' from='xmppserver.com' type='error' id='2vM3f-19'>
<command sessionid='2017-07-28T16:51:12.784282Z' node='http://jabber.org/protocol/admin#delete-user' xmlns='http://jabber.org/protocol/commands'>
<x type='submit' xmlns='jabber:x:data'>
<field var='FORM_TYPE' type='hidden'>
<value>http://jabber.org/protocol/admin</value>
</field>
<field var='accountjids' type='jid-multi'>
<value>jid@xmppserver.com</value>
</field>
</x>
</command>
<error code='400' type='modify'>
<bad-request xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
</error>
</iq>
我也尝试发送裸JID(即没有主机名部分),但结果是一样的。
这不是一个特别有用的错误消息。
我做错了什么?
[1] https://xmpp.org/extensions/xep-0133.html#delete-user
答案 0 :(得分:0)
显然&lt;错误代码='400'类型='修改'&gt;是eJabberD说'找不到用户,没有删除'的方式。