1

My project need to use the same passport session (login + password) i entered on my main server. The session must be used to connect me to another server automatically (when i click on a link).

Example : I login to my main server and i have a list of link of all other server hostname. When i click on a link, i must be logged in automatically.

I found these solution but i do no understand how it work. What i must do to other servers to catch the passport session provided by the main server and connect me automatically ?

Node+Passport.js + Sessions + multiple servers

Community
  • 1
  • 1
visualight
  • 145
  • 1
  • 2
  • 9

1 Answers1

0

It sounds like you want is single sign on. The way this works is that you'll typically log into a domain like login.mydomain.com, and then be redirected (while authenticated) to another domain.

The way authentication typically works in this manner is by using a JWT (JSON Web Token) which includes auth information.

There are not many tools I know of that do this in the Node world.

The only one I'm familiar with is a paid server (Stormapth). Full disclosure: I work there.

The way the Stormpath stuff works is that you can use our Express.js library like so: https://docs.stormpath.com/nodejs/express/product.html#use-hosted-login

Basically what happens is Stormpath hosts the single sign on domain (login.yoursite.com), and the Node library handles redirecting users there for login, and then sends the user back to wherever they were going authenticated properly.

rdegges
  • 32,786
  • 20
  • 85
  • 109