This is a simple Spring Boot application that connects to Salesforce via the REST APIs.
Run on Heroku:
-
Fill in the
Connected App Name
,API Name
, andContact Email
fields -
Select
Enable OAuth Settings
and enter the followingCallback URLs
:https://YOUR_HEROKU_APP_NAME.herokuapp.com/login http://localhost:8080/login
-
Select
Full access (full)
from the list of OAuth Scopes and clickAdd
-
Click
Save
and themContinue
to complete the creation of the new Connected App -
Manage the settings for your Heroku app (via the Heroku Dashboard) and add
SECURITY_OAUTH2_CLIENT_CLIENT_ID
andSECURITY_OAUTH2_CLIENT_CLIENT_SECRET
config vars using the values from the newly created Connected App -
Wait about 10 minutes until the OAuth app creation is completed
-
Check out your your new app
Run Locally:
-
If you haven't already done so, create a Salesforce Connected App following the instructions above
-
Create a file in the root project directory named
application.properties
that contains:security.oauth2.client.client-id = YOUR_CONNECTED_APP_CLIENT_ID security.oauth2.client.client-secret = YOUR_CONNECTED_APP_CLIENT_SECRET
Note: Make sure you do not put this file in SCM!
-
Start the local server via Gradle:
Mac & Linux:
./gradlew dev
Windows:
gradlew dev
-
Check out the app: http://localhost:8080