何时应该使用服务器端与客户端的Facebook身份验证流程? [英] When should the server-side vs. client-side Facebook authentication flows be used?
问题描述
Facebook有两个身份验证,客户端和服务器端的流。每个人应该何时使用?
Facebook has two flows for Authentication, client-side and server-side. When should each one be used?
Facebook文档: https://developers.facebook.com/docs/authentication/
Facebook docs: https://developers.facebook.com/docs/authentication/
可能相关:在OAuth 2中的隐式授权授权类型的目的是什么?
Possibly related: What is the purpose of the implicit grant authorization type in OAuth 2?
推荐答案
根据您的需要,您可以使用一个或另一个或两者。如果您希望在用户看到某个页面之前对Facebook进行调用,那么请使用服务器端...但是,如果要在用户验证之前显示部分信息,请使用JavaScript身份验证。
Depending on your needs you can use one or the other or both. If you want calls to facebook to be processed before the user sees a certain page then use server side... however if you want to display partial information until the user has authenticated, use javascript authentication.
它归结为:
- Javascript身份验证可以在弹出窗口中窗口,并且不需要页面重新加载,您也可以执行top.location.href重定向。
- PHP身份验证涉及到身份验证页面的重定向。 / li>
- Javascript authentication can happen with-in a popup window and does not require a page reload you can also just perform a top.location.href redirect.
- PHP authentication involves a redirect to an authentication page.
这篇关于何时应该使用服务器端与客户端的Facebook身份验证流程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!