Managing ejabberd users from Node.js or other server app

Hello and thanks for ejabberd :)

I run 2 different machines, one with a node.js app and one with ejabberd server.
They share the same db already. In particular, I managed ejabberd to do the oauth and storing of offline messages with the remote db.
I would like to be able to run "register", "add_roster_item", send messages and a few more commands from my node app. As far as I understand, these are the options available to achieve this effect:

1 enable mod_http_api with oauth support, but the documentation states that these commands are not yet available
2 enable mod_http_api without oauth, and I should have all the commands at hand
3 enable mod_rest and launch any command with it
4 write to ejabberd db tables directly, miming the effect of launching those commands

What is the best practice according to you? Any other ideas?

Thanks in advance

4 is the worst because you

4 is the worst because you bypass controls like username character checks, password character checks...

The other ones are all acceptable, it just depends on what you want to use, and if one of them has some problem. mod_rest is the one I know, there's also ejabberd_xmlrpc, and mod_http_api should support all commands like the other ones, no idea what problem 1 is.

using the oauth2 support, is

using the oauth2 support, is there a way to make the token validity last forever?

the oauth_expire option seems to accept only seconds

Well, 10 years is almost

Well, 10 years is almost forever, right? In seconds:
60*60*24*365*10 = 315360000

Syndicate content