大家好,我正在使用 ejabberd,我想生成一个不记名令牌来访问所有方法并使用 ejabberd 的 REST 获取数据。当我尝试生成标头中没有身份验证的承载令牌时,它显示一个错误,即
我正在为ejabberd_http模块使用端口 5180 我的配置是
port: 5180
ip: "::"
module: ejabberd_http
request_handlers:
/admin: ejabberd_web_admin
/api: mod_http_api
/xmlrpc: ejabberd_xmlrpc
/oauth": ejabberd_oauth
api权限的配置是
oauth_access:
- allow:
- user:
- "admin@localhost" # add your user name
oauth_expire: 86400
acl:
local:
user_regexp: ""
loopback:
ip:
- 127.0.0.0/8
- ::1/128
- ::FFFF:127.0.0.1/128
- ::FFFF:43.250.158.125/16
admin:
user:
- "admin@localhost"
ip:
- "::"
- ::FFFF:43.250.158.125/16
api_permissions:
"some XMLRPC commands":
from: ejabberd_xmlrpc
who:
- ip: 127.0.0.1
- user: admin@localhost
what:
- "*"
# - registered_users
# - register
# - connected_users_number
# - change_password
# - check_password_hash
"admin access":
who:
ip: 127.0.0.1/8
oauth:
scope: "ejabberd:admin"
access:
allow:
acl: loopback
acl: admin
what:
- "*"
"console commands":
from:
- ejabberd_ctl
who: all
what: "*"
"loopback access":
who:
- ip: "::"
what:
- "*"
"public commands":
who:
ip: 127.0.0.1/8
what:
- "*"
access_rules:
register:
allow: all
# configure:
# - allow: all
local:
# allow
allow: all
c2s:
# deny: blocked
allow: all
announce:
allow: all
configure:
allow: all
muc_create:
allow: all
pubsub_createnode:
allow: local
trusted_network:
allow: all
我想使用其余部分将消息发送给用户,但为此我需要不记名令牌,当我尝试生成不记名令牌时显示错误请建议我一些方法来解决此问题并生成不记名令牌
谢谢