permaculture playing cards
The moose likes JForum and the fly likes Integrating JForum to OpenID4Java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JForum
Bookmark "Integrating JForum to OpenID4Java" Watch "Integrating JForum to OpenID4Java" New topic

Integrating JForum to OpenID4Java

Programming Student

Joined: Dec 07, 2012
Posts: 2
Hello, guys!

So, the focus of this post is to show you guys that I managed to integrate OpenID4Java (v 0.9.6) with JForum (v 2.1.8). Took me a really lot of time, but given that it was to a school assignment, was completely worth it and I thought sharing it would be helpful to someone else.

What I basically did was:

- Utilize SSO forum's configurations (Also, Anonymous are not allowed to access, neither typical login, i.e., login and password form are hidden. The only way to access the forum is utilizing OpenID).
- Implement an GlassFish Authentication Module called OpenID4JavaAuthModule. (PS.: based on Ralph's Java Blog)
- Implement Attribute Exchange with Google, myOpenID and Yahoo!.
- Update Attribute Exchange configurations (they were a bit outdated, which took me a while to realize(!)... )

Also, applied a few fixes:
- Users names will be their real names published when loggin in (obtained via Attribute Exchange)
- If a user's got the same name as someone else already registered, his nickname will be Name + (x), where x will be the number of users with the same name. (Example: Test, Test(1), Test(2), and so on)
- Fixed a problem when a user could not view someone else's posts through his profile page.

There are few settings that I was not able to get an easy fix, though. One of them is because of the default Admin Login. It is "Admin", but, due to access restrictions (remember that no one is able to access the forum through form), other users will not be able be given different groups (e.g. General, Administration etc.) neither the Administration Control Panel will be available. The workaround was: run jforum-2.1.9 (the original version!) available on JForum's official website, install it, and insert a login according to the name you will publish via OpenID. Next step is get the folder WEB-INF/database/hsqldb and copy it to my JForum's version.

For Example: My name is Abraham Lincoln (according to the information I have in my OpenID provider). So, I run jforum-2.1.9, install it, and there I register myself with the login "Abraham Lincoln". I Logout, Login with the login of Admin (password: a) and put Abraham Lincoln in the Administration Group. Next, I access jforum-2.1.9 WEB-INF/database/hsqldb folder and copy it to Jforum's (my version) same folder.


Above of all, here is the download link to my modified version of JForum.


-> Glassfish
In order to setup glassfish 3.1.2 execution environment, again I utilized Ralph's Java Blog. Also, I had to use some others libraries. All of them will be listed in the image I'll attach to this post.

- The first step was to create an Provider, according to Ralph's Blog Post. The GlassFishSetup.jpg shows how I did it.
- Next, the libraries. In the domain's ext folder, I had to put a lot of libraries. Almost all of them are included on official OpenID4Java's download page. (Image DomainExtLib.jpg).
* There needs to be a .jar called jForumJar in the "glassfish-3.1.2\glassfish3\glassfish\lib" folder. Without it, the Provider created in the first step won't work.

-> Project
In the project, there's a Build Path jar called missing, which is part of the GlassFish version you are using. Given that you'll use Eclipse to open the Project, in the build path you can pick this jar on (glassfish-3.1.2\glassfish3\glassfish\modules) folder.
- Once that is done, you're now free to generate the JforumJar mentioned above.
*Note: You cant setup proxy in the class. By default there is no proxy.

-> Once these things are done, you simply have to load the JForum's project folder into glassfish.


Hope you guys enjoy! :-)

Thank you!

[Thumbnail for GlassFishSetup.jpg]

[Thumbnail for DomainExtLib.jpg]

Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 33102

Welcome to CodeRanch!

Thanks for sharing this! The next person who needs to do it will be happy not to spend all that time.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Programming Student

Joined: Dec 07, 2012
Posts: 2
Jeanne Boyarsky wrote:Please see your private messages about an important administrative matter.

Thank you for pointing that out. Already made a request.
I agree. Here's the link:
subject: Integrating JForum to OpenID4Java
It's not a secret anymore!