Skip to content

This is a little demo app I built on node as part of a learning adventure for oAuth in Salesforce

Notifications You must be signed in to change notification settings

herokumx-team/Salesforce-oAuth-Demo

 
 

Repository files navigation

Node.js oAuth Demo App - Salesforce as IDP

This is a demo application that showcases an implementation of oAuth from Salesforce in Node.js.

Installation

Firstly, setup your Salesforce Org with a connected app. Remember! You will have to come back here and update your callback URL once you get it.

Building the App locally

Before you start, make sure you've got Redis running locally. (If not, it's okay - we can wait)

Firstly, clone (or fork and clone) the App.

git clone https://github.com/adamSellers/Salesforce-oAuth-Demo.git

Change directories and install stuff

cd Salesforce-oAuth-Demo && npm install

Create the .env file

touch .env

Then add the following config vars

CLIENTID={your salesforce client id}
CLIENTSECRET={your salesforce client secret}
CALLBACKURL=http://localhost:3001/salesforce/auth
REDISSECRET={A super secret string}
REDIS_URL={your redis URL}

remember, head back to your connected app and update that Callback URL!

Once all that is done, you are good to go!

npm start

Then navigate to http://localhost:3001 to get started.

Build in Heroku (recommended)

Heroku Deploy

Firstly, clone (or fork and clone) the App.

git clone https://github.com/adamSellers/Salesforce-oAuth-Demo.git

Create your app

heroku apps:create

git push the world!

git add .
git commit -m "slinky heroku"
git push heroku master

Provision the Redis addon

heroku addons:create heroku-redis:hobby-dev

Add your config vars

heroku config:set CLIENTID={your client id} CLIENTSECRET={your client secret} CALLBACKURL={https://{YOURAPPNAME}.herokuapp.com/salesforce/auth}

Then you're good to go

heroku open

About

This is a little demo app I built on node as part of a learning adventure for oAuth in Salesforce

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 92.0%
  • HTML 6.6%
  • CSS 1.4%