Warning
This repository is generated from content that lives at github.com/FusionAuth/fusionauth-site. Changes to files here will be overwritten by that automation. File an issue or pull request with fusionauth-site instead.
This project is an example Node.js application that illustrates how to integrate with FusionAuth using the Authorization Code grant and demonstrates how User Actions work by logging the emails and triggered webhooks.
This example goes with the User Actions guide. The guide walks through the FusionAuth setup. To install FusionAuth locally, see Install Locally.
-
log into the admin UI of FusionAuth and edit your application. Switch to the OAuth tab and enter the following values.
- set Authorized redirect URLs
http://localhost:3000/oauth-redirect - set Logout URL
http://localhost:3000/logout - make sure your user has a first name.
- note your client id and client secret
- set Authorized redirect URLs
-
copy
.env.sampleto.envand update it with your Client Id, Client Secret and FusionAuth instance base URL. -
run
npm install -
npm start
Open a new terminal window and run
npx maildev -v;
Browse to http://localhost:1080/ so that you can see emails arrive as you test Actions.
Log in to FusionAuth and navigate to Tenants. Edit the "Default" tenant. Click on the Email tab and enter the following values:
If FusionAuth is running on Docker.
Host: host.docker.internal
Port: 1025
If FusionAuth is running on localhost.
Host: localhost
Port: 1025
Click Send test email and an email should arrive in the MailDev web interface