powered by Jive Software

How to forbid user to login from multiple clients at the same time

A user can login by using PC client (pidgin, spark, …) and mobile client (beem, gibberbot, xabber, …) . however, I want to forbid user to login from multiple clients and a user can only login by using one xmpp client at the same time. System properties like xmpp.session.conflict-limit, route.all-resources can do this ? how ? i tried route.all-resources, but it didn’t work.

There is no such option

I would imagine a plugin that would reject multiple logins is your only option.

No, I don’t know how to write such a plugin, assuming it is possible.

i did try to write such a plugin to kick out the former login session and it took effect, but many xmpp client will reconnect openfire server while i closed connection manually, so the result is that two client will login and be kicked out, login and be kicked out, again and again.

I think there is another way to “kick” the session when a client won’t try to reconnect, but i don’t know how to do it. Just sometimes a client disconnects and doesn’t try to reconnect (from my observations).

this is how i implemented to close the former login session.

XMPPServer server = XMPPServer.getInstance();

SessionManager sm = server.getSessionManager();

Collection sessionList = sm.getSessions(username);

for(ClientSession session : sessionList){

session.close();

}

right ?