I'm currently integrating JForum into a NetBeans Javaservlets / JSP application and I have some questions about the best way to go about creating users 'on the fly' in JForum. This is the first stage of the broader integration I'm looking at.
At the moment I am using JForum as a separate application under Tomcat from its own .war file. My application, from another .war file, calls JForum and can quite happily log a user in; but I have to pre-create that user in JForum manually.
What I'm looking for is to do this automatically from my application so that everything is seamless.
So my question is, is it better to use my own APIs in my application to call SQL insert statements to create data in JForum's own database tables or is it better to use the SSO methods defined in threads like this one:
And if I use the latter, do I need to compile JForum's code into a .jar file so that I can use it as a library in my own application's code?
I would rather avoid having to change JForum's code beyond the need to remove some options from its JSPs .
Any help would be welcome.
Martin O'Shea. [originally posted on jforum.net by MartinOShea]
Migrated From Jforum.net
posted 11 years ago
You can do what you want in any of the ways you have laid out.
That said, my preference is to do it via the SSO methods and jForum's DAO functions. The advantage here is that all the jForum code stays in the jForum context and this means that the memory repository updates can also be done as needed.
The basic "trick" is to include your own variation of the SSOUtils register method in your SSO's authenticateUser method. Using this you can populate all the jForum user fields with info from your main app.
Take a look at the code in this posting (about line 116) for a simple example:
You might also think about adding a check in for existing users to verify that the main app data is the same. E.g., someone changes a name in the main app and needs it updated in the jforum info. [originally posted on jforum.net by monroe]
I am a man of mystery. Mostly because of this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!