Create the App
- In Salesforce, from Setup, enter Canvas App Previewer in the Quick Find box, then select Canvas App Previewer.
- Click Heroku Quick Start.
- In the Template field, select Java – Quick Start Template.
- In the Canvas App Name field, enter a unique name of up to 30 characters.
- In the Heroku App Name field, enter a unique name of up to 30 characters that begins with a letter and contains only lowercase letters, numbers, and dashes. The newappName must be unique across all Heroku apps. This name becomes part of the URL for your app, for example, newappName.herokuapp.com.
- In the Auth Type field, select API Key. Find the API key associated with your account on the Heroku My Account page.
-
Click Create. The app displays in the left navigation
pane.
If you see the error “Error [Read timed out] executing POST to Heroku clone REST service,” then the operation timed out when it tried to contact Heroku. You can check the status of Heroku at http://status.heroku.com.
-
Click the link to your new app.
The app appears, and you see the message Hello User.FullName, as well as other information about the current user.
You just created a canvas app—congratulations! You can see your canvas app only in the Canvas App Previewer until you set the locations where it can appear by following the steps in Set the App Location. This setting defines where a user sees your app after it’s installed in their org.
Behind the scenes, Heroku Quick Start sets the canvas app’s Permitted Users, which includes admin-approved users and your profile. For example, if your user profile is System Administrator, that profile is added to the canvas app you created, and any users with that profile can access the canvas app.
We recommend that you inspect the code to see how the canvas app works. The source code for the app is available in the canvas-quickstart-java public GitHub repository. Use the example code to learn how to decode and validate the canvas signed request in your app.