Register a new user in ejabberd using Erlang

岁酱吖の 提交于 2019-12-25 03:45:19

问题


I am using erlang 17, ejabberd 14.07. I am trying to create chat application, For that I have to create user for ejabberd using Erlang. I have search but nothing found useful. There are three ways to do registration as far I have explored.

  1. Using command line
  2. From localhost
  3. Using other api

Is there any method in ejabberd which help me to register new user? I am new in Erlang and ejabberd so it becomes useful to me if you describe step if any configuration required.


回答1:


Do you mean that you want to call an Erlang function to create a user? You can use ejabberd_auth:try_register for that:

ejabberd_auth:try_register(<<"username">>, <<"example.com">>, <<"secret_password">>).


来源:https://stackoverflow.com/questions/25541829/register-a-new-user-in-ejabberd-using-erlang

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!