如何使用Oauth支持配置ejabberd

时间:2016-01-13 03:20:39

标签: oauth token ejabberd

我已尝试按照here步骤配置ejabberd 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: true

注意:我重启了ejabberd。

我使用过的网址(这是我输入的页面用户服务器密码):http://mytestsite.com:5280/oauth/authorization_token?response_type=token&client_id=Client1&redirect_uri=http://mytestsite.com&scope=user_get_roster+sasl_auth

我已被重定向到https://mytestsite.com/?error=access_denied&state=&gws_rd=ssl

根据教程,一旦我在.yml文件中启用了/ oauth和/ api,以下网址就会将我重定向到http://mytestsite.com/?access_token=RHIT8DoudzOctdzBhYL9bYvXz28xQ4Oj&token_type=bearer&expires_in=3600&scope=user_get_roster+sasl_auth&state=

1 个答案:

答案 0 :(得分:0)

您必须在ejabberd.yml配置文件中定义oauth_access参数,否则,任何人都无法创建oauth令牌。

我们将更新文档,使其更加准确。