powered by Jive Software

Double login

Hi

i’'ve integrated a smack client to my java application… but i have a problem with login.

when i try to login with username and password, it works successfully. but, if this client is logged in, and i try to login with the same username and password from another application the login works and i have two client connected with the same username and password.

i would like to prevent the second login (if the first client is still connected)…

how can i do that?

tnx

bye

harkonnen

This is an integral feature of XMPP and shouldn’'t be prevented. You can set the priority of your own connection high enough so that all non-directed messages to the user get sent to your client.

That said, you always get the presence packets of other connections and could terminate if the application receives one.

This is an integral feature of XMPP and shouldn’'t be prevented. You can set the priority of your own connection high enough so that all non-directed messages to the user get sent to your client.

for me its a problem… because your solution cannot be use in my application. but i need to resolve this problem.

That said, you always get the presence packets of other connections and could terminate if the application receives one.

i dont understand what you want to say, could you exaplain me that again?

bye

v.harkonnen

v.harkonnen wrote:

for me its a problem… because your solution cannot be use in my application. but i need to resolve this problem.

What is your application?

i dont understand what you want to say, could you exaplain me that again?

When you send your initial presence, you get presence packets from all available JIDs where you have a subscription of “from” or “both” on your roster, plus the presence packets from other resources of your own account.

What XMPP server are you using? I know that this can be configured in Wildfire. Typically, XMPP servers allow multiple connections of the same username/password as long as the resource is unique per connection.

Hi,

to prevent the second login you must make sure that both connections use also the same resource.

Wildfire and probalby also other servers offers a “Conflict Policy” option “Never kick” to make sure that the 2nd connection does not succeed.

See http://server:9090/session-conflict.jsp if you run Wildfire:

+XMPP allows multiple logins to the same user account by assigning a unique “resource name” to each connection. If a connection requests a resource name that is already in use, the server must decide how to handle the conflict. The options on this page allow you to determine if the server always kicks off existing connections, never kicks off existing connections, or sets the number of login attempts that should be rejected before kicking off an existing connection. The last option allows users to receive an error when logging in that allows them to request a different resource name. +

LG

Ok

perfect! i resolve this problem setting the session conflict properties as you suggested me!

thanks

bye

harkonnen