简体   繁体   English

Facebook身份验证问题

[英]Problems with Facebook authentication

Okay, I hate facebook now. 好吧,我现在讨厌facebook。 I've been fighting with this far too long. 我已经为此斗争了太久了。

I'm trying to use facebook as the login for my website, similar to what's done on stack overflow actually. 我正在尝试使用Facebook作为我的网站的登录名,实际上类似于在堆栈溢出时所做的事情。

I've got my application setup and I've gone through step by step the Facebook guides but can't get anywhere. 我已经完成了应用程序设置,并且一步一步地完成了Facebook指南,但无所适从。

I'm using the code examples from my app dashboard: 我正在使用我的应用程序仪表板中的代码示例:

require 'facebook-php-sdk/src/facebook.php';

$facebook = new Facebook(array(
  'appId'  => 'xxxxx',
  'secret' => 'xxxxx',
  'cookie' => true, // enable optional cookie support
));


<div id="fb-root"></div>
<fb:login-button>Login with Facebook</fb:login-button>

This gives me a button, but as soon as I click the button it opens a new window and a blank page. 这给了我一个按钮,但是当我单击该按钮时,它会打开一个新窗口和一个空白页面。 any suggestions on what I'm doing wrong? 关于我在做什么错的任何建议?

Thanks 谢谢

Look here: http://developers.facebook.com/docs/reference/plugins/login/ . 在这里查看: http : //developers.facebook.com/docs/reference/plugins/login/ Generate the code for the button with the widget on that page. 使用该页面上的小部件生成按钮的代码。

I think you may be confusing the server-side usage of the API and the client-side usage. 我认为您可能会混淆API的服务器端用法和客户端端用法。 Decide which one you're going to need. 确定您将需要哪个。 If you're going to primarily use the API server-side, you can checkout the example they include in the facebook SDK package, it's pretty straightforward and should be enough to get you up and running. 如果您将主要使用API​​服务器端,则可以查看它们包含在facebook SDK软件包中的示例,它非常简单,应该足以使您启动并运行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM