This project is two example Node.js applications that illustrates how you can easily implement sessions using refresh tokens to give you fine grained revocation using FusionAuth.
Docker and the ability to edit your hostnames file.
- Create two local aliases in your DNS:
changebank.localandchangebankforum.local, both resolving to127.0.0.1. - Run
docker compose up -d. This will run FusionAuth and configure it using Kickstart- Two users are created, both with the password `password.
- admin@example.com is an admin user that can log into the admin UI, located at http://localhost:9011.
- richard@example.com is a user that can log into the two application you'll start below.
- To stop FusionAuth later, run
docker compose down
- Two users are created, both with the password `password.
- In the
changebankdirectory, run:npm installnpm run dev
- In the
changebankforumdirectory, run:npm installnpm run dev
In an incognito window, go to http://changebank.local:8080/ and login with richard@example.com. Check 'keep me signed in'.
You'll be able to log into your ChangeBank account and make change.
Now, say you want to discuss whether nickels are better than dimes? Head over to the forum by clicking on 'Forum' in the navigation. You'll be transparently logged in.
In the non-incognito window, log into the admin UI using the credentials above. You can then navigate to Richard's account (under 'Users') and view the 'Sessions' tab, which will show you the sessions.
If you log out of ChangeBank Forum, you are only logged out of that application. If you log out of ChangeBank, the user is logged out of everything (all refresh tokens are revoked).
Learn more about Logout and Session Management in FusionAuth
This was last reviewed Jun 2024.