I am working on ejabberd API to invite users to MUC room. I have setup OAuth for API.
I have tested oauth with get_room_occupants and its working fine.
Now, I am trying to access /api/send_direct_invitation
, but as per logs, I don't have permission to access this api
I have generated oauth with command line
ejabberdctl oauth_issue_token admin@host 31540000 "ejabberd:admin"
Do I need to pass any extra permissions
Ejabberd Version: 17.11
Installed on: ubuntu 16.04
Configuered DB: mysql
Here is a ejabberd.yml
file
api_permissions:
"console commands":
from:
- ejabberd_ctl
who: all
what: "*"
"admin access":
who:
- access:
- allow:
- user: admin@host
- oauth:
- scope: "ejabberd:admin"
- access:
- allow:
- user: admin@host
what:
- "*"
- "!stop"
- "!start"
"public commands":
who:
- ip: "127.0.0.1/8"
what:
- "status"
- "connected_users_number"
commands_admin_access:
- allow:
- user: "admin@host"
commands:
add_commands:
- status
- registered_users
- register
- unregister
- get_roster
- connected_users
- send_stanza_c2s
- send_stanza
- join_cluster
- send_direct_invitation
oauth_expire: 3600
oauth_access: all
I tried running this via command line and got this error
command: ejabberdctl send_direct_invitation naviteam1519 conference.xxx.yyy.com "" "You need this room!" [email protected]
error:
Problem 'error {bad_jid,<<"[email protected]">>}' occurred executing the command.
Stacktrace: [{jid,decode,1,[{file,"src/jid.erl"},{line,138}]},
{mod_muc_admin,'-get_users_to_invite/2-fun-1-',2,
[{file,"src/mod_muc_admin.erl"},{line,840}]},
{lists,filtermap,2,[{file,"lists.erl"},{line,1317}]},
{mod_muc_admin,send_direct_invitation,5,
[{file,"src/mod_muc_admin.erl"},{line,826}]},
{ejabberd_ctl,call_command,4,
[{file,"src/ejabberd_ctl.erl"},{line,352}]},
{ejabberd_ctl,try_call_command,4,
[{file,"src/ejabberd_ctl.erl"},{line,321}]},
{ejabberd_ctl,process2,4,
[{file,"src/ejabberd_ctl.erl"},{line,271}]},
{ejabberd_ctl,process,2,
[{file,"src/ejabberd_ctl.erl"},{line,249}]}]