powered by Jive Software

How do developers write the sign-in code for openfire server?

I am using registration.jar plugin (http://www.igniterealtime.org/projects/openfire/plugins.jsp) plugin to register users at openfire server. This is how the data in the table looks after the registration (using the same plugin):

The password as shown is in the encrypted form. So how do I make the user connect to the openfire server ?

(This snippet is from the official documentation)

Connection connection = new XMPPConnection(“server”);

  • connection.connect();*

  • connection.login(“mtucker”, “password”)*

  • Chat chat = connection.getChatManager().createChat("jsmith@jivesoftware.com", new MessageListener() {*

  • public void processMessage(Chat chat, Message message) {*

  •               System.out.println("Received message: " + message);*
    
  •         }*
    
  • });*

  • chat.sendMessage(“Howdy!”);*

What password do I enter in :

connection.login(“mtucker”, “password”);

because the password saved in the database is in the encrypted form.

How do developers write the sign-in code for openfire server ?

I would think you’d pass in the un-encrypted form, so that it may be checked against the stored value and validated. However, I’m not 100% on this as I have not looked at how Openfire does this…

From your provided snippet, it looks like Connection class would have to be extended someplace within openfire codebase to provide the .login() and .getChatManager() methods… so I’d start by finding that class and checking out it’s javadoc for any hints.

Here’s Openfire’s source for you to browse: http://fisheye.igniterealtime.org/browse/openfire/trunk

Actually, didn’t realize this was from Smack –

Here’s the XMPPConnection class which does extend Connection class:

http://fisheye.igniterealtime.org/browse/smack/trunk/source/org/jivesoftware/sma ck/XMPPConnection.java?hb=true

And here’s the Connection class:

http://fisheye.igniterealtime.org/browse/smack/trunk/source/org/jivesoftware/sma ck/Connection.java?hb=true

javadoc for Connection.login() begins on line 342 - there’s a public void login() as well as a public abstract void login() below it…

Thanks for the help.

Can you have a look at this question http://community.igniterealtime.org/message/232177#232177 . I set a status and when later I try to retrieve it I get null. I am using smack api .

Thanks for the help.

Can you have a look at this question http://community.igniterealtime.org/message/232177#232177 . I set a status and when later I try to retrieve it I get null. I am using smack api .