This folder contains an example app that demonstrate how to use the CMP SDK package with an expressjs app.
- Install ngrok and set it up. Then run
ngrok http 30000
-
Go to Welcome and create an app if you don't have one already. Use
<your ngrok url>/tests/oauth/callback
as the redirect url. -
create a
.env
file, and save the following variables
CMP_CLIENT_ID=<your app client id>
CMP_CLIENT_SECRET=<your app client secret>
-
Go to the
config.js
file and update theredirectUri
value to<your ngrok url>/tests/oauth/callback
. -
In another terminal, run the following
cd Example
npm install
npm start
- Open your browser and go to
localhost:30000
or<your ngrok url>
. When you test the OAuth module and test a successful authorization, the tokens will be stored in memory (or in the database if you are using one) and used in other module tests.