Closed pinanklakhani closed 1 year ago
You should define an actual host, wildcard is not a valid value :)
Ok but users will be dynamic for me with different domains in their email
Then setup hosts for those domains, you need to provide certs for those domains too.
@licaon-kter Practically it is not possible as there can be n number of domains as my platform is for enterprises they can signup any time and use
When they sign up you add another domain in hosts:
, put the domain certs in the proper place and run ejabberdctl reload_config
to be able to serve it.
You can automate this...
@licaon-kter Okay. Let me check for other ways as well
Chat application is as module in my platform and users with any email domain can use chat module after login. I am using user's email as jid and kept hosts value as * but in that case its giving following error.
Umm, try this idea:
For example, if you configure:
hosts:
- yourdomain.com
Tell your users to define their XMPP JID like this:
yourdomain.com
Let's imagine my email address is john@gmail.com
. I can register an account in your server with
john#gmail.com
yourdomain.com
john#gmail.com@yourdomain.com
This works in ejabberd (and any other XMPP server), and works with all Jabber/XMPP clients:
ejabberdctl register john#gmail.com yourdomain.com asd
User john#gmail.com@yourdomain.com successfully registered
And login:
2023-03-02 14:01:01.472163+01:00 [info] (<0.1297.0>)
Accepted connection [::ffff:127.0.0.1]:36137 -> [::ffff:127.0.0.1]:5222
2023-03-02 14:01:02.316141+01:00 [info] (tls|<0.1297.0>)
Accepted c2s DIGEST-MD5 authentication for john#gmail.com@yourdomain.com by mnesia backend from ::ffff:127.0.0.1
2023-03-02 14:01:02.384197+01:00 [info] (tls|<0.1297.0>)
Opened c2s session for john#gmail.com@yourdomain.com/tkabber
Standard escape for @ in jid is \40 (so it would be jim\40gmail.com) - this is defined in https://xmpp.org/extensions/xep-0106.html, it's even possible that some client will do that for you when you use '@' in username.
Thanks @badlop I moved with the similar type of implementation where i took users unique id as username and appended my domain.
Chat application is as module in my platform and users with any email domain can use chat module after login. I am using user's email as jid and kept hosts value as * but in that case its giving following error.
ejabberd.yml
error