Vipul
Vipul

Reputation: 111

Sharing session between two node apps using SSO

I have an existing website which is built using express and node.js , I have to incorporate nodebb forum in that website which is again a different node application, I am using facebook login for both of them but I have to login into them seperately one by one(using same facebook app for both). What I want to do is,

1.Login via fb or any sso in the main site and the user should be logged in the forum via the same automatically.

2.How can I integrate nodebb in my website so that the look and feel doesn't change, it looks like I am on a completely different website, just need some tips to integrate nodebb in my existing website.

How can I achieve these two?

Upvotes: 0

Views: 1147

Answers (1)

Julian H. Lam
Julian H. Lam

Reputation: 26134

(Hey there @Vipul, NodeBB dev here) When you establish the express session your app, what are you setting the cookie's domain to?

;domain=domain (e.g., 'example.com', '.example.com' (includes all subdomains), 'subdomain.example.com') If not specified, defaults to the host portion of the current document location.

-- MDN

You'll probably want to set it to .your-domain.com, and likewise for NodeBB (do it in the "Settings/Advanced" section):

... in NodeBB

Then also make sure the key in your app is set to express.sid, which is the value we use, and that the secrets match.

Upvotes: 2

Related Questions