问题描述
我想在Salesforce iFrame中显示我的网站,当有人在iFrame内的网站上进行任何活动时,我还要更新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?
我可以这样做,请建议吗?
Can i do this, please suggest?
推荐答案
最新的方法,现在是GA, - 这是基于iframe的附加安全和功能,包括将上下文(如Salesforce字段)传递到iframe 。它还使iframed Web应用程序可以使用Canvas框架中的凭据通过JavaScript或后端Web应用程序(Python,Java等)基于该身份验证调用Salesforce API。
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.
您还可以使用Canvas中的新事件功能将消息发送到框架Salesforce页面。
You can also use the new Events feature within Canvas to send messages to the framing Salesforce page.
关于身份验证选项:建议使用Canvas Signed Request身份验证并且很简单,但请注意,它不会为OAuth2提供刷新令牌 - 因此,如果您需要根据用户的身份验证继续进行后台处理,则应使用Canvas OAuth2身份验证,这样可以为您提供刷新令牌。
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比使用原始iframe更干净,应该简化开发。它确实需要对iframed Web应用程序中的身份验证进行一些更改,但它们相对简单(10行左右的Python)。
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).
这篇关于基于iframe的Salesforce集成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!