atakane / fusionauth-example-node

Node.js example application that uses the OAuth 2 Authorization Code grant

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FusionAuth Node.js example

This project is a simple example Node.js application that illustrates how to integrate with FusionAuth's OAuth system using the Authorization Code grant.

This application will use an OAuth Authorization Code workflow and the PKCE extension to log users in. PKCE stands for Proof Key for Code Exchange, and is often pronounced “pixie”.

To run

This assumes you already have a running FusionAuth instance, user and application running locally. If you don't, please see the 5-Minute Setup Guide to do so.

  • update your FusionAuth application to allow a redirect of http://localhost:3000/oauth-redirect
  • make sure your user has a first name.
  • npm install
  • update routes/index.js and views/index.pug with the client id of your FusionAuth application.
  • update routes/index.js with your client secret.
  • npm start

Go to http://localhost:3000/ and login with the previously created user.

You should see 'Hello '

About

Node.js example application that uses the OAuth 2 Authorization Code grant


Languages

Language:JavaScript 89.7%Language:Pug 10.3%