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 Emailfields -
Select
Enable OAuth Settingsand 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
Saveand themContinueto 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_IDandSECURITY_OAUTH2_CLIENT_CLIENT_SECRETconfig 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.propertiesthat contains:security.oauth2.client.client-id = YOUR_CONNECTED_APP_CLIENT_ID security.oauth2.client.client-secret = YOUR_CONNECTED_APP_CLIENT_SECRETNote: Make sure you do not put this file in SCM!
-
Start the local server via Gradle:
Mac & Linux:
./gradlew devWindows:
gradlew dev -
Check out the app: http://localhost:8080