I am developing a lightning application that points to a web application using Canvas Frame (IFrame can also be used). Every customer has a specific instance of myApp with a different subdomain. For example CUSTOMER1.myApp.com, CUSTOMER2.myApp.com.

I am currently using a Canvas Frame to display the Web App in a Salesforce Visual Page. Is there a way to change the subdomain in the Package? As far as I know, it is only possible to use app.setCanvasUrlPath('/alternatePath'), but this will not change the subdomain.

I have in mind two solutions, but I am not sure if they are optimal or will pass the security check.

  1. Create the package and set the default URL to FREETRIAL.myApp.com This will be submitted for Security Review -> Published in the AppExchange.

    We can then create customized packages for customers, updating the URL to CUSTOMERX.myApp.com and sending them the package individually. Is this an accepted practice? Is completely not optimal since we need to create a package per customer.

  2. Pointing the default Canvas app to a redirection URL. For example www.myApp.com/redirection. Passing the information from the customer (Subdomain name) using app.setCanvasUrlPath() and handling the redirection to the right instance in www.myApp.com/redirection. Will this pass the security review?

1 Answer 1


The second approach is more practical provided you have a subdomain for each customer .

The approach that I have adopted in the past is to have a proxy central url where one can decode the signed request using the consumer secret key and the client Id stored securely in the server protected resource where the proxy url is hosted .

Then use parameters tag on the canvas markup to pass the domain from the custom setting .(Your subscriber org will have to store the custom setting).Once successful decode we will redirect the user to the necessary url based on parameter value .

The security team wants to ensure you store the secret and the consumer key in a protected resource and you have a decode logic set up to verify signed request .

  • Thanks. Does my proxy central URL need to be in the same domain too? Could you tell me where can I find more information about "decode logic"?
    – Hugo
    Nov 22, 2017 at 8:34
  • You can find it here github.com/forcedotcom/canvas-quickstart-java .Take a peak into example of how this works .The signed.jsp shows enough examples .Your proxy can be in any domain Nov 23, 2017 at 21:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .