node-sample-app
An instructional sample application that details how to access Citi's Accounts API through 3-legged OAuth. For more details on Citi's APIs, visit developer.citi.com. To successfully run the application: Running the application:
-
Register for a Citi Developer Hub Account.
-
Login to the Citi Developer Hub.
-
Create a new application. 3a. enter 'https://127.0.0.1:3000/accounts/retrieve' as your redirect URI. Write down your client id and client secret (CLIENT_ID, CLIENT_SECRET).
-
Create a new folder for your sample application.
-
Install or ensure that you have the latest versions of Node (https://nodejs.org) and OpenSSL (https://openssl.org).
-
Using OpenSSL in your new folder, execute the following command: openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -days 365. Write down whatever password you create (CERTIFICATE_PASSWORD). For COMMON NAME, put 'localhost'. Verify that key.pem and cert.pem exist in your new folder.
-
Place package.json, index.html, and server.js in your new folder either through direct download or git.
-
Enter your application credentials into config.json and login.html. CLIENT_ID, CLIENT_SECRET, and CERTIFICATE_PASSWORD are what were copied above - enter them into config.json. In login.html - replace <REPLACE WITH YOUR APPLICATION'S CLIENT ID> with your CLIENT_ID.
-
in your new folder, run the following command: node server.js
-
You should get a confirmation the server is running on port 3000.
-
Navigate to https://127.0.0.1:3000 on your browser. accept the self-signed certificate, and follow the onscreen prompts to test your application.