Creating a connected application 

The first step is to make sure the Node.js app can authenticate with Salesforce and obtain the access token that the Lightning Out application will need. In order to do this, we will create a connected application in Salesforce that will allow the Node.js application to go through the OAuth flow.

Prior to creating a connected application, we will need to create a Heroku application. Use the following commands to create a new Heroku app. Let's make a local directory for this application and name it ltngOutApp:

$ mkdir ltngOutApp  // Make a directory named ltngOutApp
$ cd ltngOutApp // cd into the directory
$ git init // Initialize the Git repository
$ heroku apps:create ltngOutApp // Create a Heroku application named ltngOutApp

To create a connected application in Salesforce, navigate to Setup | Apps | Connected Apps | New. This is shown in the next screenshot.

You will need a callback URL for the connected app. To set the callback URL, you can provide a localhost URL like http:localhost:8200/oauthcallback.html and a Heroku app URL obtained from the Heroku application creation commands listed earlier. There can be many callback URLs in connected apps and they are separated by line breaks, as shown in the following screenshot:

The consumer key is created from the connected application.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
13.58.51.228