第一次在冷熔中使用我的FB应用程序时不需要Facebook按钮
|
我正在玩Facebook应用程序,使用ColdFusion在iframe中创建它们。
以下是我的应用程序的网址http://apps.facebook.com/firstones/
与其直接进入权限页面,不如进入下图所示的页面。
在单击那个大的“ Facebook”按钮后,它会寻求应用程序许可。授予权限后,它将进入我托管该应用程序的网站,而不仅仅是在Facebook中打开它。
以下是我的画布网址的代码[http://www.dkyadav.com/firstOnes/auth/]
index.cfm
<cfparam name=\"client_id\" default=\"1234\"> <!---same as app_id --->
<cfparam name=\"redirect_uri\" default=\"http://www.dkyadav.com/firstOnes/auth/\">
<cfparam name=\"redirect_uri_final\" default=\"http://www.dkyadav.com/firstOnes/\">
<cfparam name=\"scope\" default=\"user_education_history,user_hometown,friends_education_history \">
<cfparam name=\"client_secret\" default=\"56789\"> <!---- App_secret key ---->
<cfif not isdefined(\'url.code\')>
<Cflocation url=\"https://www.facebook.com/dialog/oauth?client_id=#client_id#&redirect_uri=#redirect_uri#&scope=#scope#\" >
<Cfelse>
<Cfif isdefined(\'url.error\')>
<Cfoutput>
#url.error#<br />
Access denied.
</Cfoutput>
<cfelse>
<cfoutput>#url.code#<br />
<cfhttp url=\"https://graph.facebook.com/oauth/access_token\" result=\"token\">
<cfhttpparam name=\"client_id\" value=\"#client_id#\" encoded=\"no\" type=\"url\">
<cfhttpparam name=\"redirect_uri\" value=\"#redirect_uri#\" encoded=\"no\" type=\"url\">
<cfhttpparam name=\"client_secret\" value=\"#client_secret#\" encoded=\"no\" type=\"url\">
<cfhttpparam name=\"code\" value=\"#url.code#\" encoded=\"no\" type=\"url\">
</cfhttp>
<cflocation url=\"#redirect_uri_final#?#token.filecontent#\" addtoken=\"no\">
</cfoutput>
</Cfif>
</cfif>
在http://www.dkyadav.com/firstOnes/index.cfm中,我寻找access_token并拥有其余的应用程序。
我只是在第一次运行时才执行上述操作。一旦获得许可,它就会按预期正常工作。
您可以尝试自己运行此应用程序http://apps.facebook.com/firstones/
请帮助,让我知道我实际上在想什么。谢谢!!
没有找到相关结果
已邀请:
2 个回复
济畦刨
函数中的http://www.dkyadav.com/firstOnes/index.cfm上看到该Javascript:
“ 3”是指窗口层次结构顶部的窗口,在您的情况下,是指其中包含iframe的实际Facebook主页。 希望有帮助!
弦砂牧扁