Sign up a new user

I’m working with Openfire and Smack. My problem is, whenever I want to sign someone up I need to log into Openfire, like this:

connection.login(Username, Password); AccountManager accountManager = AccountManager.getInstance(connection); accountManager.createAccount(Username1, Password1);

So, can I somehow avoid this useless login?

Thank you.

P.s. Sorry, couldn’t appropriately insert code because something went wrong and code doubled itself.

``

An alternative approach could be to develop a small web service at your server which interacts with openfire about new account creation. The web service could call internally some openfire plugin like rest api or user service plugin. So your app can call this web service in order to create a new account.

(maybe not a perfect solution but I am sure that its far better than the one you mentioned)

Do not login() when using createAccount(), simply connect() to server and call createAccount().