1

当我已经在同一个会话或另一个会话中登录我的 facebook 帐户时,如何使用 facebook 凭据登录我的网站。例如,我登录了我的 fb,当我在同一会话或另一个会话中打开名为 rottentomatoes.com 的网站时,我可以自动登录,无需执行任何操作,因为该站点使用我的 fb 帐户并自动获得注册该网站的会员。

我想在我的网站上做这些事情,比如烂番茄发生的事情。

到目前为止,我可以使用 fb 帐户使用 facebook connect 登录我的网站。

请帮助我....任何建议都将受到欢迎。

4

1 回答 1

1

You need to have a facebook app, then in your site use the facebook js sdk.

You always have different sessions per site, you'll need to make a session for yours, you don't use the facebook session, just the sdk.

When the user loads your page you can use the FB.getLoginStatus to check if the user is logged into facebook and is authenticated with your app, if so then you get the needed user data and can then log the user into your site.

If the user is not logged into facebook, or hasn't authorized your app then you can use the FB.login method to log the user in, when the user comes back from that process you should have the data you need in order to register/log him into your site.

于 2012-05-03T06:55:51.180 回答