This repo holds two example JavaScript applications.
- MoneyScope, a financial analysis tool
- Changebank APIs
This application will use an OAuth Authorization Code Grant workflow to log a user in, request needed OAuth Scopes and get them access and refresh tokens. The access token will be used to make a request against the Changebank APIs to find the user's balance.
This application was built to illustrate the API Consents Platform use case.
The docker-compose.yml
file and the kickstart
directory are used to start and configure a local FusionAuth server.
The moneyscope-application
directory contains a fully working version of the MoneyScope application.
The changebank-apis
directory contains a fully working version of the Changebank APIs.
create-application
is a directory that contains a FusionAuth SDK script to create the third-party application instead of using Kickstart. It can safely be ignored.
- Docker, for running FusionAuth
- Node 20.12.2 or later, for running the applications
- A valid Essentials or Enterprise license key
First, edit kickstart/kickstart.json
and add a valid Essentials or Enterprise license key. Look for the line "licenseId": "LICENSE ID",
and replace LICENSE ID
with a valid key.
To run FusionAuth, just stand up the docker containers using docker compose
.
docker compose up
This will start a PostgreSQL database, OpenSearch service, and the FusionAuth server.
For the MoneyScope application:
Copy the env.sample
file to .env
and edit it if needed. (For example, if you are using a remote FusionAuth instance.)
cd moneyscope-application
npm install
npm run dev
In a separate terminal window, to start the Changebank APIs:
Copy the env.sample
file to .env
and edit it if needed. (For example, if you are using a remote FusionAuth instance.)
cd changebank-apis
npm install
npm run dev
Visit the local webserver at http://localhost:8080/
and sign in using the credentials:
- username: [email protected]
- password: password
Accept the scopes and you'll be logged into the MoneyScope application.
You can modify the bank balance by changing the APIs in the changebank-apis/routes/index.js
file.