如何将facebook登录与您的网站整合? [英] how to integrate facebook login with your website?

查看:149
本文介绍了如何将facebook登录与您的网站整合?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我做了一些研究,我似乎完全不知道如何将facebook登录与您的网站进行整合。

I made some research and i can't seem to completely undestand how to integrate facebook login with your website.

我试图为旧的时尚的php商店,到目前为止,并没有使用任何类型的登录,而只是一个会话允许用户浏览页面和添加项目到购物车。

I'm trying to do this for an old fashioned php shop that, up till now, doesn't use any type of login, but only a session that allows users to browse across pages and add items to cart.

我在这里读到stackoverflow,你需要一个数据库中的表来保留用户的电子邮件地址和facebook_id。所以之后,我可以与我的数据库中的其他表联系起来,以便为每个用户提供更多信息。

I read here, on stackoverflow, that you need a table in your database to keep the user's email address and facebook_id. So after that i can hook up with other tables in my db in order to provide info and much more to each user?

有其他方法可以轻松地将您的网站与Facebook和Google帐户?我读了一些关于OpenID的内容,但并没有真正了解它的用途:)

Are there other ways to easily integrate your website with facebook&google accounts? I read something about OpenID, but didn't really understand what's its use :)

所以这就是为什么我要你们把我放在轨道上。我真的很新,任何建议,最佳做法等将不胜感激!

So that's why i'm asking you guys to put me on track :). I'm really new with this and any advice, best practices etc.will be greatly appreciated!

谢谢!

推荐答案

Facebook登录背后的想法很简单:用户访问Facebook页面,登录到Facebook,Facebook担忧细节,最终只会让您(服务器)竖起大拇指,一个id,意思是我们肯定地证实了这个用户的身份,它是用户174264384。您的服务器随时可以随意使用此信息。如果您想跨多个访问跟踪用户,那么是的,您可能希望将该数字与任何其他信息一起存储在数据库中。下一次Facebook告诉您用户174264384已登录,您可以从数据库中获取任何相关信息。

The idea behind Facebook login is simple: The user goes to the Facebook page, logs in there, Facebook worries about the details and eventually just gives you (your server) a thumbs up and an id, meaning "we have positively confirmed the identity of this user, it's user 174264384". Your server is then free to do whatever it likes with this information. If you want to track a user across several visits then yes, you'll probably want to store that number in a database together with any additional information. The next time Facebook tells you user 174264384 has logged in, you can get any associated information back out of your database.

希望有助于作为30,000英尺的概述。 Facebook如何安全地验证用户并将此信息传回服务器的详细信息最好由 PHP SDK 。如果您想了解详细信息,请阅读文档

Hope that helps as a 30,000 feet overview. The details of how Facebook can securely authenticate a user and hand this information back to your server are best handled by the PHP SDK. Read the documentation if you want to explore the details.

OpenID基本上做同样的事情,只有技术细节不同,它不是特定于Facebook。 Oauth是另一种非常相似的技术。

OpenID basically does the same thing, only the technical details differ and it's not specific to Facebook. Oauth is another very similar technology.

这篇关于如何将facebook登录与您的网站整合?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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