Hot answers tagged

101

Canvas App Canvas apps are designed to the part of the user interface. Either the app is designed to appear to be native to salesforce.com, like a Visualforce page, or is intended to be accessed through salesforce.com, such as legacy cloud apps. Authentication for a canvas app is server-initiated and controlled by profiles and permission settings. The app ...


12

http://www.salesforce.com/us/developer/docs/platform_connect/Content/quick_start_config_who_can_access_canvas_app.htm In your connected application you will see related list where you can configure both profiles and permission sets allowed to pre-authorize your connected application


11

Here is a start. I'll try and flesh it out as time permits. In the Org that will be the target of the Canvas App Create an Apex Class to be the Controller. This controller will handle the processing of the signed_request POST data. Connected App Controller to process the Signed Request: public class CanvasSignedRequestController { public String ...


11

This is a long answer that attempts to explain exactly what's going on here, and how HTML5 and the Force.com Canvas SDK allow safe cross-origin access. It may be that your issue has no solution, but at least you'll understand why! The same-origin policy restricts how a document or script loaded from one origin can interact with a resource from another ...


9

Actually that is not correct - with Winter '16 we not only fixed the issues with Canvas and Lightning Experience/S1 (the way canvas was originally integrated into these applications actually violated the Lightning security model and its functionality was blocked as it was supposed to be). This has been corrected and in addition we have released the force:...


8

So there are a couple of ways to do this: Create 3 canvas apps in your org. Each of these apps would have a different Canvas URL which would point to the different pages in your web app. For instance, Canvas1 would have a URL of https://www.myapp.com/page1. Canvas2 would have a URL of https://www.myapp.com/page2. Canvas3 would have a URL of https://www....


8

Practically, canvas apps are accessible inside salesforce and can be build using any language of your choice. By this, I mean we can interact with salesforce from a external application, but within salesfore and with an interactive UI. Canvas don't work in offline mode as they have an UI, but connected apps can access data from salesforce even if user is ...


7

Embedding a Lightning .app is totally possible using any iframe based approach including Canvas. This is embedding a single page app though which is a very course grained approach which might be fine if the interaction is also course grained. We're actively working on Lightning Out to allow you to directly embed lightning components cross domain - they run ...


7

The wiring to do this is mostly there, but lightning apps don't have access to Sfdc.canvas at present, it seems. If they did have access to Sfdc.canvas then this would work. You can send a message from the canvas app, and it will reach the containing window, but it seems there's no way to listen for it at present. You can also subscribe to events in the ...


6

Ok, so I was just attending the webinar on canvas apps and as an aside they answered the question we've been burning to understand. To publish a connected app, you must first establish a namespace for your development org. You can do this under setup -> create -> packages -> developer settings edit Once you have saved a namespace, you'll see the publish ...


6

See Signed Request Authentication. Has: a change been made to the Permitted Users field from "Admin approved users are pre-authorized" to "All users may self-authorize", or when using "All users may self-authorize" and the access token was revoked by the administrator or a time limit was set on the token. From the docs under Permitted User Value "All ...


6

Here is a step-by-step click path to create a Salesforce Canvas App that uses a POSTed Signed Request to a Visualforce Page with an Apex Controller (and the Apex Controller successfully validates the Signed Request). Note that in practice, I have always had Canvas Apps pointing to external platforms such as Heroku Express/Node, Java or Ruby. So I typically ...


6

Aura Components are not going to be deprecated any time soon . I raised this question on the twitter to the PM for canvas and LWC and here is the response from him , please check screenshot below Hence for few more releases I think you will have to use the force:canvasapp and the aura bundle .


5

I encountered this error in a Canvas app I recently developed, the sub-text below the error for me gave me the direction i needed to resolve it.... The canvas app requires you to set permitted users in order to be rendered. Please configure the app polices to "Admin-approved users" instead of "All Users" and grant users access by profile or permission set ...


5

Use different callback URLs for the two connected apps (if you are not already), and store the two sets of connected app credentials in your Node app's configuration, indexed by the callback. Now you should be able to get the correct credentials at runtime.


5

I got it working. The app side is a .NET site where I validate the signedRequest and save the Json to the hidden variable. My problem was that I was using the signedRequest and not the decoded Json. On the VF page I was missing the scripts for the controller and connection. Here is the correct code: <script type="text/javascript" defer="defer"> ...


5

I had the same problem in a Summer 16 pre-release org. I had a Lightning Component in a Visualforce page. The Lightning Component contained the force:canvasApp component and demonstrated the same behavior as described in the Question when the parameters attribute was used with the following syntax: parameters="{param1:'value1'}". I found that the only ...


5

For a simple use-case like that, I would just use a Web Tab. Canvas is more than you need, for sure. When it comes time to pass parameters out to the 3rd-party site, you'll need to change it up a bit. I'd use a Visualforce Tab at that point. Set it to load a Visualforce page that's only job is to dynamically create the parameters for the 3rd-party URL, ...


4

In order to make Apex REST calls from your Chatter page via JavaScript you need to utilise the client proxy built into canvas. There is some more detail and examples of this here. var sr = JSON.parse('<%=signedRequestJson%>'); // Reference the Chatter user's URL from Context.Links object. var url = sr.context.links.chatterFeedsUrl+"/news/"+sr.context....


4

OutputLabel wont help you here. Use an Image tag basically if you have data in base64encoded in the signatureCanvas variable of your code <img id="image" alt="data url loaded image" /> If above is the image tag ,then use the following java-script onload to show on vf <script> var dataURL="data:image/jpeg;base64,"+{!signatureCanvas}; ...


4

There is already a nice blogpost on how to do this http://corycowgill.blogspot.in/2013/12/capturing-signatures-with-html5-canvas.html global with sharing class AnyObjectSignatureController { public AnyObjectSignatureController(){ } @RemoteAction global static String saveSignature(String signatureBody, String parentId) { try{ system.debug('...


4

As far as I'm aware, there's no way to specify this in your package at this time. You will need to include that in your documentation, and possibly also program your app to notify users that they need to contact an admin when this situation is detected.


4

I just ran into this problem. The default maxHeight of a canvas app is 2000px. Apparenlty, you can't go beyond the maxHeight even when using the canvas sdk. You have to explicitly set your maxHeight to 'infinity' (or some other number if you don't want it to be able to grow indefinitely). This allows the canvas app to extend beyond the 2000px limit. <...


4

The issue seems to be due to the data in the MessageEvent being sent by the Salesforce InteractionFramework. The data in a successful MessageEvent should look something like this: interactionApi/?method=onClickToDial&<some data about the record/phone number> which indicates the message is for the interaction api and the method is ...


4

You will use apex:canvasApp tag on your visualforce markup <apex:page controller="JSONGeneratorSample"> <apex:canvasApp developerName="mycanvas" parameters="{!generateJSON}" /> </apex:page> Note that you can either use Application Name or Developer Name . Once your Visualforce page is rendered ,it will make a GET Request to the ...


4

This question is, effectively, asking the difference between authorization and authentication. OAuth 2.0 is an authorization standard. The access token you receive from the server authorizes you to make requests against the server (in this case, the Salesforce API) and access specific resources without having to store the user's credentials. You declare ...


4

These are the steps I used to create a Canvas App as part of the Can I embed a Salesforce app, via Canvas, in another org? question. This was pre-Lightning UI, but it hopefully gives you more direct steps to follow. I'll modify them slightly to make more sense for your scenario. Create a Canvas App Username > App Setup > Develop > Create > Apps [New: ...


4

The lightning:container uses a static resource hosted in Salesforce, while force:canvasApp allows you to embed any site that uses the Canvas API. The difference is location. The one that you use is the one that makes the most sense. Almost all apps would presumably be better suited as a force:canvasApp, but if all you have is source code (e.g. there's no ...


3

I have confirmed this is a problem. However there is a workaround Sfdc.canvas.client.ajax('/services/proxy', { client : sr.client, method: 'GET', contentType: "application/json", headers : { "SalesforceProxy-Endpoint" : sr.client.instanceUrl + "/services/apexrest/Account/001i000000iLoMf", "...


3

I did get this to work eventually....looks like the link to Controller.Js in the docs is broken - they sent me this link that does work I added that js code into my calling VF page, and was then able to click a link on my originating VF page to trigger an event in the Canvas App to post back to Chatter in my Org the value from my event... <apex:page >...


Only top voted, non community-wiki answers of a minimum length are eligible