OAuth2.0-demo-nodejs
OAuth2.0-demo-nodejs copied to clipboard
A sample demo app to showcase the OAuth2.0 and openID Connect authorization workflows using an express app
Intuit OAuth2.0 Sample - NodeJS
Overview
This is a sample
app built using Node.js and Express Framework to showcase how to Authorize and Authenticate using Intuit's OAuth2.0 Client library.
Installation
Requirements
- Node.js >= 8.x.
- Intuit Developer Account
Via Github Repo (Recommended)
$ npm install
Configuration
Copy the contents from .env.example
to .env
within the sample directory:
$ cp .env.example .env
Edit the .env
file to add your:
- PORT:(optional) Optional port number for the app to be served
-
NGROK_ENABLED:(optional) By default it is set to
false
. If you want to serve the Sample App over HTTPS ( which is mandatory if you want to test this app using Production Credentials), set the variable totrue
TLS / SSL (optional)
If you want your enpoint to be exposed over the internet. The easiest way to do that while you are still developing your code locally is to use ngrok.
You dont have to worry about installing ngrok. The sample application does that for you.
- Just set
NGROK_ENABLED
=true
in.env
Usage
$ npm start
Without ngrok (if you are using localhost i.e NGROK_ENABLED
=false
in .env
)
You will see an URL as below:
💳 See the Sample App in your browser : http://localhost:8000
💳 Copy this into Redirect URI on the browser : http://localhost:8000/callback
💻 Make Sure this redirect URI is also copied on your app in : https://developer.intuit.com
With ngrok (if you are using ngrok i.e NGROK_ENABLED
=true
in .env
)
Your will see an URL as below :
💻 See the Sample App in your browser: https://9b4ee833.ngrok.io
💳 Copy and paste this Redirect URI on the browser : https://9b4ee833.ngrok.io/callback
💻 Make Sure this redirect URI is also copied on your app in : https://developer.intuit.com
Click on the URL and follow through the instructions given in the sample app.
Links
Project Repo
- https://github.com/IntuitDeveloper/OAuth2.0-demo-nodejs
Intuit OAuth2.0 API Reference
- https://developer.intuit.com/app/developer/qbo/docs/develop/authentication-and-authorization/oauth-2.0
Intuit OAuth2.0 Playground
- https://developer.intuit.com/v2/ui#/playground
Contributions
Any reports of problems, comments or suggestions are most welcome.
Please report these on Issue Tracker in Github.