【发布时间】:2017-10-31 14:39:53
【问题描述】:
我正在尝试在没有身份验证的情况下访问 ejabberd rest api,但总是得到带有此正文的 403 Forbidden 响应:
{
"status": "error",
"code": 32,
"message": "AccessRules: Account does not have the right to perform the operation."
}
我无法在 /api/status 端点上得到 OK 响应,这是来自 127.0.0.1 的所有用户都应该能够使用的命令(请参阅 ejabberd.yml 中 api_permissions 下的“公共命令”部分)。
这是请求详细信息(通过 Insomnia REST 客户端):
> POST /api/status HTTP/1.1
> User-Agent: insomnia/5.1.0
> Host: localhost:5280
> Accept: */*
> Accept-Encoding: deflate, gzip
> Content-Type: application/json
> Content-Length: 2
| {}
Ejabberd 版本为 17.04,从下载的 deb 包安装并以 ejabberd 用户身份在 Debian 8.8 (jessie) x86_64 上运行。
安装后,我只是添加了主机“localhost”,为 localhost 注册了一个新用户“admin”并将其添加到 ACL。
我对 ejabberd.yml 所做的唯一更改:
hosts:
- "localhost"
acl:
admin:
user:
- "admin": "localhost"
否则,我可以访问运行良好的 webadmin 界面...
我该怎么做才能得到 200 OK 响应?
【问题讨论】:
标签: rest ejabberd ejabberd-api