简体   繁体   English

Salesforce中基于iframe的集成

[英]Iframe based integration in Salesforce

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? 我想在Salesforce iFrame中显示我的网站,当有人在iFrame中对我的网站进行任何活动时,我也想更新Salesforce页面吗?

Can i do this, please suggest? 我可以这样做吗,请提出建议?

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. Force.com Canvas是一种较新的方法,现在称为GA。这是基于iframe的,具有附加的安全性和功能,包括将诸如Salesforce字段之类的上下文传递到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. 它还使iframed Web应用能够使用Canvas框架中的凭据通过JavaScript或后端Web应用(Python,Java等)基于该身份验证来调用Salesforce API。

You can also use the new Events feature within Canvas to send messages to the framing Salesforce page. 您还可以使用Canvas中的新事件功能将消息发送到框架Salesforce页面。

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. 在身份验证选项上:建议并使用Canvas Signed Request身份验证很容易,但是请注意,它不会为您提供OAuth2的刷新令牌-因此,如果您需要基于用户的身份验证继续进行后台处理,则应使用Canvas OAuth2而是使用身份验证,它确实为您提供了刷新令牌。

Overall, Canvas is cleaner than using a raw iframe and should simplify development. 总体而言,Canvas比使用原始iframe更干净,并且应该简化开发。 It does require some changes to authentication in the iframed web app but they are relatively simple (10 lines or so of Python). 它确实需要对iframed Web应用程序中的身份验证进行一些更改,但它们相对简单(Python大约10行)。

You can use Javascript and page refreshing to send information to the parent window, but this isn't in my recommended books. 您可以使用Javascript和页面刷新将信息发送到父窗口,但这在我推荐的书中没有。 iFrames are not meant to communicate with it's parent site for security reasons. 出于安全原因,iFrame不能与其父站点进行通信。

You might want to look into using an API to communicate between the two sites. 您可能需要研究使用API​​在两个站点之间进行通信。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM