Ely Celino wrote: > Hi everyone, > > After implementing AccountManagement, I realized I need other data other > than user and password in addUser(user, password) function.
A user in Vyser (and XMPP) is uniquely identified by it's JID (the XMPP spec uses the term 'entity'), for example "[email protected]". And the user parameter MUST contain a valid JID, otherwise the system will be unable to log the user on. So if you have a relational DB as an account backend, make sure it the JID column is UNIQUE. This criteria is absolutely sufficient within Vysper and no other IDs are needed. > > My user db consolidates all my client's record. To distinguish every client > I added client_id column. So if query for a user, I will search by username > plus client_id. Now, if I understand your requirements correctly, you have more than one way to go forward in your case: 1. Don't use AccountManagement at all for adding users. Add users by using your own object model, bypassing AccountManagement or even going directly to the DB. Note, that you won't get around providing a proper implementation of AccountManagement for verifyAccountExists(). 2. Extend AccountManagement and use the extended implementation for adding users. 3. Use the JID as the ID in your DB. 4. There is a general mechanism for storing arbitrary additional information for a user: Private XML Data, which let's you store any data you like for a user account. > Of course I could use the username parameter to the addUser function by > concataning other information to it but we know it will be ugly. That's another possibility, and extremely bends the original contract of addUser(). But since addUser is used for nothing else than adding users, it should work. > Is this a limitation of the AccountManagement? For your use case, probably, yes. HTH, Bernd
