This application demonstrates how to set up and deploy an ID.me integration using Heroku. Follow the steps below to configure, set up, test, and deploy the application.
- Create an
Organization
. - Within your
Organization
, create aConsumer
with:Type
set toOAuth
Sandbox Mode
should be unchecked- Click
Add Redirect URI
and inputhttp://localhost:5001/callback
- Within your
Organization
, create anID.me Social Login
/NIST IAL1/AAL1
Policy
following the playbook. - Copy your
Client ID
andClient Secret
for future use.
-
Prepare your app by cloning the repository:
git clone https://github.com/IDme/demo-app cd demo-app
-
Check
node
version and ensure you are using version 18 or later:node --version
-
Check
npm
is installed by Node:npm --version
-
Check
git
version to confirmgit
is installed:git --version
-
Check
heroku
version to confirmheroku
is installed:heroku --version
-
Log into Heroku CLI (VPN must be turned off for this step):
heroku login
You will be prompted to sign into Heroku and redirected back to your terminal after successfully authenticating.
-
Initialize your
git
repository with Heroku:heroku git:remote -a <your Heroku app name>
-
Install the necessary dependencies:
npm install
-
Create a
.env
file in the root directory of your project and add the following environment variables:SANDBOX_CLIENT_ID=<your ID.me Sandbox Client ID> SANDBOX_CLIENT_SECRET=<your ID.me Sandbox Client Secret> PRODUCTION_CLIENT_ID=<your ID.me Production Client ID> PRODUCTION_CLIENT_SECRET=<your ID.me Production Client Secret>
-
Set the environment variables in Heroku:
heroku config:set SANDBOX_CLIENT_ID=<your ID.me Sandbox Client ID> heroku config:set SANDBOX_CLIENT_SECRET=<your ID.me Sandbox Client Secret> heroku config:set PRODUCTION_CLIENT_ID=<your ID.me Production Client ID> heroku config:set PRODUCTION_CLIENT_SECRET=<your ID.me Production Client Secret>
-
Run the application locally to ensure everything is set up correctly:
npm start
-
Open your browser and navigate to
http://localhost:5001
to test the application.
-
Commit your code to
git
and deploy to Heroku usinggit
:git add . git commit -a -m "make it better" git push heroku master
Your application should now be deployed to Heroku and accessible via your Heroku app URL.