Ilias Tsagklis

About Ilias Tsagklis

Ilias Tsagklis is a senior software engineer working in the telecom domain. He is an applications developer in a wide variety of applications/services. Ilias is co-founder and Executive Editor at Java Code Geeks.

Openfire server configuration – Infrastructure for Instant Messaging

This tutorial is the second part of the “Setting up an infrastructure for Instant Messaging” article series. After installing the Openfire server (“Openfire server installation“), we are now ready to create some users.

Login to the admin console and choose “Users/Groups”. There you should see the existing users under “User Summary”. Only “admin” is currently existent, so choose “Create New User” from the left panel.

Fill in the user’s information as shown above and make sure the “Is Administrator” option is not selected. Hit the “Create & Create Another” button to create the current user and repeat the procedure to create a second one. I created users “testuser1” and “testuser2”.

Now let’s use an XMPP client to actually connect to the server. I will use Spark, an open source, cross-platform IM client provided by Ignite Realtime, the same company that provides Openfire. Download the latest version here. I chose the Windows platform version, the one where JRE is not bundled (since I have Java already installed). The current version is 2.5.8 (direct link here).

Run the installer and after the installation is complete, launch the application. You should see the following picture:

To login, use one of the users that you created above (I chose “testuser1”), provide the corresponding password and also fill the server hostname (or IP address) in the “Server” field.

Then hit the “Login” button and if you correctly connect, you should see the following picture:

You now can do all the usual IM stuff, i.e. add friends to your roster, create groups, set your current status etc.

On the server side, the current client sessions can be monitored via the admin console. Hit the “Sessions” button and you will find the active client sessions as shown below:

Note that by default, users can automatically create new accounts. To do that in Spark, hit the “Accounts” button (logout first if necessary). In the screen that appears, fill in the desired username, the password and the server to which the user will be created.

If you wish to configure manually the creation of new users, you can change the default behaviour by logging into the Openfire admin console and go to “Server ? Server Settings ? Registration & Login”.

In the “Registration Settings” interface that appears, you can configure the “Inband Account Registration”, that is whether users can automatically create new accounts. Another option that should be disabled for security issues is the “Anonymous Login”. Finally, using the “Restrict Login” feature, you can restrict the IP addresses or IP address ranges that clients are allowed to login from.

Full configuration of the Openfire server is out of the scope of this tutorial, but note that useful guides can be found under the “documentation” folder of the Openfire distribution file.

As a final thing, I will show you how to use Spark to connect to Google’s server with your Google Talk account. There are two things to bear in mind:

  • For the username, you have to provide your Google Talk username without any @ symbol or domain.
  • The server to connect to is gmail.com (and not talk.google.com)

Happy chatting!!!

Related Articles :
Related Whitepaper:

Java Essential Training

Author David Gassner explores Java SE (Standard Edition), the language used to build mobile apps for Android devices, enterprise server applications, and more!

The course demonstrates how to install both Java and the Eclipse IDE and dives into the particulars of programming. The course also explains the fundamentals of Java, from creating simple variables, assigning values, and declaring methods to working with strings, arrays, and subclasses; reading and writing to text files; and implementing object oriented programming concepts. Exercise files are included with the course.

Get it Now!  

One Response to "Openfire server configuration – Infrastructure for Instant Messaging"

  1. prasanna jatla says:

    when i try to connect to an account from spark by giving newly installed openfire server hostname its saying that server can’t find or unreachable and how it will be possible for others to connect to my server i hav no idea regarding this .rpy aeap thanks in advance.

Leave a Reply


7 × eight =



Java Code Geeks and all content copyright © 2010-2014, Exelixis Media Ltd | Terms of Use
All trademarks and registered trademarks appearing on Java Code Geeks are the property of their respective owners.
Java is a trademark or registered trademark of Oracle Corporation in the United States and other countries.
Java Code Geeks is not connected to Oracle Corporation and is not sponsored by Oracle Corporation.

Sign up for our Newsletter

15,153 insiders are already enjoying weekly updates and complimentary whitepapers! Join them now to gain exclusive access to the latest news in the Java world, as well as insights about Android, Scala, Groovy and other related technologies.

As an extra bonus, by joining you will get our brand new e-books, published by Java Code Geeks and their JCG partners for your reading pleasure! Enter your info and stay on top of things,

  • Fresh trends
  • Cases and examples
  • Research and insights
  • Two complimentary e-books