I am trying to connect to ejabberd server from strophe.js. I have enabled OAuth in ejabberd and due to which I am able to get OAuth token successfully for the user, once user have been authenticated. Workflow is something like above :-
- When user registers with my web app, I create ejabberd account for user, with the same credentials.
- User logs into my web app
- On successful login, I log the user into ejabberd with the help of OAuth mechanism.
- OAuth token is passed to the client
- Now client using strophe.js makes connection with ejabberd to perform all other operations, like obtain roster list, sending presence, sending message, etc.
I am facing issue in step 4, since I am not able to find suitable way to send OAuth token to ejabberd, while making connection. Btw, I am new to strophe.js. All the example on the internet uses, username and password. I don't want to ask again user for the password, neither I want to hard code in the file.
Thanks in advance.