Skip to content

FusionAuth/fusionauth-example-node-sso

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FusionAuth Node.js SSO example

This project is two simple example Node.js applications that illustrates how you can easily implement single sign-on (SSO) using FusionAuth.

Prerequisites

Docker and the ability to edit your DNS hosts.

To run

  • Create two local aliases in your DNS: hooli.local and piedpiper.local, both resolving to 127.0.0.1.
  • Run docker compose up -d. This will run FusionAuth and configure it using Kickstart
  • In the pied-piper directory, run:
    • npm install
    • PORT=3000 npm start
  • In the hooli directory, run:
    • npm install
    • PORT=3001 npm start

Go to http:https://hooli.local:3001/ and login with [email protected]. check 'keep me signed in'.

You should see 'Hello user'.

Then click on the 'Pied Piper' link in the menu to go to http:https://piedpiper.local:3000. You won't be prompted to sign in again, but will instead automatically be logged in.

Click 'logout' and you'll be logged out of both applications.

Known issues

Logout only works with on hosts with valid TLS certificates due to browser limitations. If you don't have easy access to a FusionAuth instance with a valid TLS certificate, try using https://sandbox.fusionauth.io for the FusionAuth server. This is a shared host.

Setting up TLS certificates for local development is beyond the scope of this tutorial, but if you set up all three applications: piediper, hooli and FusionAuth with TLS, then logout will work.

Last updated

This was last reviewed Jun 2024.

About

Example of single sign-on with FusionAuth and node

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published