Clone this repository (Assuming Node.js already installed on system)
Create a ssl certificate or reuse same certificate uploaded in this repository. Refer this post to learn how to create ssl certificate using openssl
Create Connected App in your Salesforce instance with callback URL - https://localhost:8081/oauthcallback.html
. Make sure to upload server.crt as a digital certificate in connected app. You can use your own certificate as well.
Copy consumer key & secret created in connected app and update jwt_consumer_key
and client_secret
variable defined in Server.js file.
Run npm install
command in the directory where this code was downloaded. It will download all the required node modules.
Then run npm start
, or nodemon Server.js (if installed previously)
it will start the server
Navigate to https://localhost:8081/
in your browser and you would see option for all 3 Auth flow - JWT, User Agent and Web Server.
- CC Flow on API only User
- It only accepts My Domain URL
- Create Connected App & Enable Canvas in setting
- Add
https://localhost:8081/
as callback URL andhttps://sfdccanvasnodejs.herokuapp.com/signedrequest
as canvas URL - Update policy of connected app to allow per approved users to login
- Add System admin as allowed profile in Connected App
- Add Canvas app in contact pagelayout
- Run Nodejs on local system. It should be available to view in Salesforce