调用ejabberd api时出现400错误的请求错误 [英] 400 bad request error while calling ejabberd api

查看:190
本文介绍了调用ejabberd api时出现400错误的请求错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

调用ejabberd的"/api/get_roster"端点时出现400错误的请求错误.我在请求oauth令牌时将"get_roster"保留在范围内.

I am getting 400 bad request error while calling "/api/get_roster" endpoint of ejabberd. I had kept "get_roster" in the scope while requesting the oauth token.

ejabberd中出现400错误的请求错误

我猜想权限有问题.这是我的配置文件:

I guess there is some issue with the permissions. Here is my configuration file:

https://www.dropbox.com/s/his89bx39qhvr1h/ejabberd2.yml?dl=0

我尝试遵循官方文档.根据API权限指南,我还尝试添加以下属性:

I have tried to follow the official documentation. As per the API permission guide, I have also tried adding following properties:

api_permissions:
  - "Admin access":
    - who:
      - admin
    - what
      - "\*"
      - "!stop"

但是没有变化.我有以下问题:

But there was no change. I have following questions:

  1. 我在这里做什么错了?
  2. 可能的范围是什么?

推荐答案

您正在使用非常旧的Ejabberd版本.最新的是17.04,从16.01开始,API权限框架有很多更改. api_permission相关的配置来自16.12版本.有关更多详细信息,请参考.

You are using very old version of Ejabberd. Latest is 17.04 which has lots of changes in API permission framework from 16.01 . api_permission related configuration came in 16.12 version. Please refer this for more detail.

这篇关于调用ejabberd api时出现400错误的请求错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆