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 :

Do you want to know how to develop your skillset to become a Java Rockstar?

Subscribe to our newsletter to start Rocking right now!

To get you started we give you two of our best selling eBooks for FREE!

JPA Mini Book

Learn how to leverage the power of JPA in order to create robust and flexible Java applications. With this Mini Book, you will get introduced to JPA and smoothly transition to more advanced concepts.

JVM Troubleshooting Guide

The Java virtual machine is really the foundation of any Java EE platform. Learn how to master it with this advanced guide!

Given email address is already subscribed, thank you!
Oops. Something went wrong. Please try again later.
Please provide a valid email address.
Thank you, your sign-up request was successful! Please check your e-mail inbox.
Please complete the CAPTCHA.
Please fill in the required fields.

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


× seven = 21



Java Code Geeks and all content copyright © 2010-2014, Exelixis Media Ltd | Terms of Use | Privacy Policy | Contact
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.
Do you want to know how to develop your skillset and become a ...
Java Rockstar?

Subscribe to our newsletter to start Rocking right now!

To get you started we give you two of our best selling eBooks for FREE!

Get ready to Rock!
You can download the complementary eBooks using the links below:
Close