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 aConsumerwith:Typeset toOAuthSandbox Modeshould be unchecked- Click
Add Redirect URIand inputhttp://localhost:5001/callback
- Within your
Organization, create anID.me Social Login/NIST IAL1/AAL1Policyfollowing the playbook. - Copy your
Client IDandClient Secretfor future use.
-
Prepare your app by cloning the repository:
git clone https://github.com/IDme/demo-app cd demo-app
-
Check
nodeversion and ensure you are using version 18 or later:node --version
-
Check
npmis installed by Node:npm --version
-
Check
gitversion to confirmgitis installed:git --version
-
Check
herokuversion to confirmherokuis 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
gitrepository with Heroku:heroku git:remote -a <your Heroku app name>
-
Install the necessary dependencies:
npm install
-
Create a
.envfile 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:5001to test the application.
-
Commit your code to
gitand 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.