function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
anjin reddy 9anjin reddy 9 

Canvos Integration

Hi Friends,
 Please sugest me about below Queries.
1)Any can explain me about Canvos integration and I-frames
2)What is use of Canvos Integration
3)With Some Examples
4)Along with this please provide  how to integrated into Visualforcepages using Canvos Integration ,I frames

Thanks
Anjin
sandeep@Salesforcesandeep@Salesforce
1. & 2 
Force.com Canvas enables you to easily integrate a third-party application in Salesforce. Force.com Canvas is a set of tools and JavaScript APIs that you can use to expose an application as a canvas app. This means you can take your new or existing applications and make them available to your users as part of their Salesforce experience.
Canvas apps can use the OAuth 2.0 protocol to authenticate and acquire access tokens for Integration.
<%@ page import="canvas.SignedRequest" %>
<%@ page import="java.util.Map" %>
<%
// Pull the signed request out of the request body and verify and decode it.
Map<String, String[]> parameters = request.getParameterMap();
String[] signedRequest = parameters.get("signed_request");
if (signedRequest == null) {%>
This app must be invoked via a signed request!<%
return;
}
String yourConsumerSecret=System.getenv("CANVAS_CONSUMER_SECRET");
String signedRequestJson = SignedRequest.verifyAndDecodeAsJson(signedRequest[0],
yourConsumerSecret);
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<title>Hello World Canvas Example</title>
18
Quick Start—Advanced Create the Canvas App
<link rel="stylesheet" type="text/css" href="/sdk/css/connect.css" />
<script type="text/javascript" src="/sdk/js/canvas-all.js"></script>
<!-- Third part libraries, substitute with your own -->
<script type="text/javascript" src="/scripts/json2.js"></script>
<script>
if (self === top) {
// Not in an iFrame.
alert("This canvas app must be included within an iFrame");
}
Sfdc.canvas(function() {
var sr = JSON.parse('<%=signedRequestJson%>');
Sfdc.canvas.byId('username').innerHTML = sr.context.user.fullName;
});
</script>
</head>
<body>
<br/>
<h1>Hello <span id='username'></span></h1>
</body>
</html>

4. Here is the proper steps and instruction to create canvas integration
https://resources.docs.salesforce.com/sfdc/pdf/canvas_framework.pdf

Thanks
Sandeep Singhal
http://www.codespokes.com/