【问题标题】:ejabberd denies generating tokenejabberd 拒绝生成令牌
【发布时间】:2017-05-16 13:29:27
【问题描述】:

我已阅读所有我能找到的问题和答案,但 oauth 仍然无法正常工作。 这是配置 ejabberd.yml。

 port: 5280
module: ejabberd_http
request_handlers:
  "/websocket": ejabberd_http_ws
  "/log": mod_log_http
  # OAuth support:
  "/oauth": ejabberd_oauth
  # ReST API:
  "/api": mod_http_api
##  "/pub/archive": mod_http_fileserver
web_admin: true
http_bind: true
## register: true
captcha: false
commands_admin_access: configure
commands:
  - add_commands: user
oauth_expire: 3600
oauth_access: all

http://192.168.217.128:5280/oauth/authorization_token?response_type=token&client_id=somclient&redirect_uri=http://192.168.217.128:5280&scope=sasl_auth

当我打开这个 url 显示 html 表单时,我在其中写了 jid、密码和令牌 TTL(一小时)。点击接受 url 重定向后 http://192.168.217.128:5280/?error=access_denied&state=

我做错了什么?

我认为这个具体参数的地方是错误的。如果是这样,我不明白该放在哪里。

commands_admin_access: configure
commands:
  - add_commands: user
oauth_expire: 3600
oauth_access: all

对不起我的英语。

【问题讨论】:

    标签: oauth ejabberd centos7


    【解决方案1】:

    您可能没有为所有人定义正确的凭据 ACL。这意味着oauth_access 可能会被拒绝。

    【讨论】:

    • 感谢您的回复。这是我的 Acl。 acl:管理员:用户:-“管理员”:“本地主机”
    • 你指的是一个访问规则,正如我所说,它似乎没有在你的配置中定义。
    【解决方案2】:

    这是顶级选项(例如 api_permission),它不应该在任何部分,它应该从行首开始。

    您也应该将 oauth_access 设为顶级,因此您应该:

    oauth_access: all
    
    api_permission:
       "abc":
        ...
    

    参考链接:https://github.com/processone/ejabberd/issues/1661

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-09-16
      • 2017-02-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-10-02
      • 1970-01-01
      相关资源
      最近更新 更多