难以解析字符串与Facebook一点击登录和ColdFusion [英] Difficulty parsing string with Facebook one click sign on and ColdFusion

查看:245
本文介绍了难以解析字符串与Facebook一点击登录和ColdFusion的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用ColdFusion 9.0.1

I am using using ColdFusion 9.0.1

我正在建立一个将大量使用Facebook连接的网站,所以我们需要Facebook一次点击登录。具体来说,要在我们的网站上投票,访问者将只是登录Facebook,可以做各种各样的冷却的东西,而我们跟踪他们做什么使用他们的电子邮件地址。

I am building a site that will use Facebook connections extensively, so we need the Facebook one click sign on. Specifically, to vote on our site, visitors will just "log in with Facebook" and can do all sorts of cools things while we track what they do using their email address.

我只是有点困惑的Facebook文件。随着他们最近的安全更改,我在其他地方找到的大多数教程和帮助文件已过期。所以......。

I am only slightly confused by the Facebook documentation. And with their recent security change, most of the tutorials and help files I find elsewhere are out of date. So....

我在页面上的表单上有一个单击符号。当我退出Facebook时,我可以使用我的网站上的登录Facebook链接登录我的网站和Facebook。所以,我知道表单工作和cookie工程太。

I have the single click sign on form on my page. When I am logged out of Facebook, I can use the "log into Facebook" link on my site to log in to my site as well as Facebook. So, I know the form works and the cookie works too.

根据我的理解,我应该阅读Facebook在浏览器中设置的cookie,然后解析它访问我需要的信息。这是我的网站的Cookie:

From what I understand, I am supposed to read the cookie that Facebook sets in the browser and then parse it to access the info I need. Here's the cookie for my site:

cookie.fbsr_252075631496861

当我CFDUMP这个cookie,这是我得到:

When I CFDUMP this cookie, here's what I get:

 P2Hlk0UVT2EXc8LiaH48vmL_gI7Y4mwkto0IoSUN9mI.eyJhbGdvcml0aG0iOiJITUFDLVNIQTI1NiIsImNvZGUiOiIyLkFRQ0VLMC1ibzhqeVhJSzYuMzYwMC4xMzI0MzM5MjAwLjEtMTAwMDAwNTg3NDM1OTY1fFNrYkQ1NU9UWndFMTh3cGE4TUZLZkpLalZzdyIsImlzc3VlZF9hdCI6MTMyNDMzNTU2OCwidXNlcl9pZCI6IjEwMDAwMDU4NzQzNTk2NSJ9

我已经找到了如何解析这个字符串一些教程,但没有任何工程。我真的不知道我是否正在接受正确的cookie。

I have found a few tutorials on how to parse this string, but nothing works. I don't really know if I am acessing the right cookie.

现在用户通过Facebook登录我的网站,我只需要他们的FBID访问他们的信息。我相信FBID被埋在这个神秘的字符串中。

Now that the user is logged into my site via Facebook, I just need their FBID to access their info. I believe the FBID is buried in this cryptic string.

你能提供任何帮助吗?

推荐答案

一旦您解析了signed_request(存储在您的cookie中),您可以使用 user_id (即Facebook用户ID)和 oauth_token (aka access_token )通过Graph API或FQL获取所需信息。

Once you get parsed signed_request (stored in your cookie) you can use user_id (which is Facebook User Id) and oauth_token (aka access_token) to get needed info via Graph API or FQL.

这篇关于难以解析字符串与Facebook一点击登录和ColdFusion的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆