问题
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.
- Using command line
- From localhost
- 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