What's the best strategy to integrate nodeBB with another account system?
-
So I wish to inherit and incorporate nodeBB with another account system that I already have. e.g. the reputation gets updated on my other platform, and the user profile page on the other platform has access to the post history on nodeBB.
Basically I need a forum for my other platform, but I don't want to write it from scratch. If nodeBB is the wrong place to look, please let me know as well.
I'm looking into directly edit the js files but I thought it's best if I get some pointers first.
Thanks so much!
-
Best user experience is Session Sharing:
GitHub - julianlam/nodebb-plugin-session-sharing: Allows login sessions from your app to persist in NodeBB
Allows login sessions from your app to persist in NodeBB - julianlam/nodebb-plugin-session-sharing
GitHub (github.com)
Another option is Single Sign On (SSO):
GitHub - julianlam/nodebb-plugin-sso-oauth: NodeBB Plugin that allows users to login/register via any configured OAuth provider.
NodeBB Plugin that allows users to login/register via any configured OAuth provider. - julianlam/nodebb-plugin-sso-oauth
GitHub (github.com)
-
NodeBB can be great for this, it just might take some custom coding or something depending on what you are working with.
-
@scottalanmiller Thanks for the reply!
What are some resources/documentation that can help me start on this? Like a documentation on the existing code base, and where in the code should I modify for customization?
I'm probably wrong on this but I have the impression that I need to write a new plug-in for every custom feature, which I hope to avoid. -
@Samson-Liu to expand on @PitaJ's reply:
The recommended method of sharing sessions between two separate and distinct applications is through OAuth2. We recommend this approach because NodeBB maintains its own user records, so that we can keep track of user-related metrics and other data. Relying on another database would be tricky, prone to breaking, and quite possibly dangerous.
Luckily, it's quite straightforward to get things working with OAuth2!
The first step is getting your application to expose an OAuth2 endpoint. If you're running a Node.js based app, you can use a module called OAuth2orize.
Once that is set up, you'll want to take a look at the SSO plugin skeleton for customised OAuth deployments -- nodebb-plugin-sso-oauth. You'll take this plugin, fork it, and modify it to communicate with your OAuth endpoint.
Once everything is working properly, you should be able to register and log in/out via your web app.