可以做服务器 - > Facebook认证? [英] Is it possible to do Server -> Facebook authentication?
问题描述
我的快速调查似乎表明,FB已经弃用了所有的认证机制,同时留下了自己的oauth实现。
My quick investigations appear to suggest that FB has deprecated all auth mechanisms while leaving their custom oauth implementation.
有人可以评论或澄清这个陈述吗?
Can someone comment or clarify this statement ?
为什么?
- 我希望用户对我的应用进行身份验证,而不是FB
- 在稍后阶段,我希望从FB获取一些资源,例如当前的用户照片等。
推荐答案
您将至少需要一次,让他们通过Facebook ID进行身份验证,并授权您的应用程序。从那时起,您将在JSON响应中收到一个 access_token
,这将允许您为用户执行操作。
You will need at least once to let them authenticate with the facebook ID and authorize your app. From that moment, you will receive an access_token
in the JSON response that will allow you to perform operations for your user.
有两种类型的访问令牌:
There are two types of access tokens:
- 基于会话:短期到期每当您需要执行操作时,用户将被记录到FB。
- 离线访问:不要过期并允许应用执行用户在任何时刻。这在应用程序被授权时需要
offline_access
权限。
- Session based: expires in a short term, are used when the user will be logged to FB every time you need to perform an operation.
- Offline access: do not expire and allow the app to perform operations for the user in any moment. This requires the
offline_access
permission when the app is authorized.
查看这里: http://developers.facebook.com/docs/authentication/ 为oauth机制,这里: http://developers.facebook.com/docs/authentication/permissions/ 获取权限列表。
Check here: http://developers.facebook.com/docs/authentication/ for the oauth mechanism and here: http://developers.facebook.com/docs/authentication/permissions/ for the permissions list.
这篇关于可以做服务器 - > Facebook认证?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!