Iframe based integration in Salesforce

2019-07-12 04:26发布

问题:

I want to show my site inside the Salesforce iFrame, and when someone does any activity on my site inside the iFrame i want to update the Salesforce page as well?

Can i do this, please suggest?

回答1:

A more recent approach, now GA, is Force.com Canvas - this is iframe-based with additional security and features, including passing context such as Salesforce fields into the iframe. It also enables the iframed web app to call Salesforce APIs based on that authentication, either via JavaScript or by your backend web app (Python, Java, etc) using the credentials from the Canvas framework.

You can also use the new Events feature within Canvas to send messages to the framing Salesforce page.

On authentication options: the Canvas Signed Request authentication is recommended and easy, but note that it doesn't give you a refresh token for OAuth2 - so if you need to do continuing background processing based on the user's authentication, you should use the Canvas OAuth2 authentication instead, which does give you a refresh token.

Overall, Canvas is cleaner than using a raw iframe and should simplify development. It does require some changes to authentication in the iframed web app but they are relatively simple (10 lines or so of Python).



回答2:

You can use Javascript and page refreshing to send information to the parent window, but this isn't in my recommended books. iFrames are not meant to communicate with it's parent site for security reasons.

You might want to look into using an API to communicate between the two sites.