Skip to content

FusionAuth/fusionauth-example-device-limit-simple

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Example Simple Device Limiting Express.js Application Using Webhooks

This repo holds an example Express.js application that uses FusionAuth as the identity provider. This application will use an OAuth Authorization Code Grant workflow to log a user in and get them access and refresh tokens. It also implements a form of device limiting using FusionAuth's APIs and webhooks. This is a simpler example of device limiting which requires the end user to manually log out of a device when they reach the device limit.

You can read more about device limiting in the Device Limiting Guide on the FusionAuth website. The guide also contains alternative solutions to implementing device limiting and links to relevant GitHub issues.

This application is based on the Express.js Quickstart.

Project Contents

The docker-compose.yml file and the kickstart directory are used to start and configure a local FusionAuth server.

The /complete-application directory contains a fully working version of the application.

Project Dependencies

  • Docker, for running FusionAuth
  • Node 16 or later, for running the Changebank Express.js application

FusionAuth Installation via Docker

In the root of this project directory (next to this README) are two files a Docker compose file and an environment variables configuration file. Assuming you have Docker installed on your machine, you can stand up FusionAuth up on your machine with:

docker compose up -d

The FusionAuth configuration files also make use of a unique feature of FusionAuth, called Kickstart: when FusionAuth comes up for the first time, it will look at the Kickstart file and mimic API calls to configure FusionAuth for use when it is first run.

NOTE: If you ever want to reset the FusionAuth system, delete the volumes created by docker compose by executing docker compose down -v.

FusionAuth will be initially configured with these settings:

  • Your client Id is: e9fdb985-9173-4e01-9d73-ac2d60d1dc8e
  • Your client secret is: super-secret-secret-that-should-be-regenerated-for-production
  • Your example username is richard@example.com and your password is password.
  • Your admin username is admin@example.com and your password is password.
  • Your fusionAuthBaseUrl is 'http://localhost:9011/'

You can log into the FusionAuth admin UI and look around if you want, but with Docker/Kickstart you don't need to.

Running the Example App

To run the application, first go into the project directory

cd complete-application

Install dependencies

npm install

Start the application

npm run dev

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published