使用用户名/密码登录编程方式向Facebook [英] Programmatically login to Facebook using username/password

查看:140
本文介绍了使用用户名/密码登录编程方式向Facebook的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好吧,我已经一个多小时寻找关于这个问题,只能找OAuth的解决方案,我并不需要或想要。

Ok, I've been looking for over an hour on this subject and can only find OAuth solutions, which I do not need or want.

我要为自己从比Facebook以外的位置进行身份验证到Facebook。我需要我的网站(管理区)来验证Facebook的我和在后代表我,在我的墙上,还是我的朋友墙上。这是一个管理工具,我不希望每一个帖子发到我的网站时自动登录到Facebook上。我需要这个管理员扩展登录我,并添加自动化的后带标题和形象:在example.com新帖。

I need to authenticate as myself to Facebook from a location other than Facebook. I need my website (admin area) to authenticate to Facebook for me and post in my behalf, on my wall, or my friends wall. This is an administration tool, and I don't want to login into Facebook every time I post to my website. I need this admin extension to login for me, and add an automated post with a title and image: "New post on example.com".

这感觉就像我一直在到处找,只能找到创建FB的应用程序,它授予一定的权利,使用OAuth等,过于复杂的过程,这是解决方案(DARE-I-说),而愚蠢因为我不想让其他人进行身份验证,如游客。我只是想模仿我的(个体经营|浏览器),就好像我是一个通过自己的网页,而不是一个自动化的工具导航。当然,我可以走大概卷曲方式模拟真实用户代理,但我不是要开始刮FB页面。

It feels like I've been looking everywhere and can only find solutions with creating a FB application, granting it certain rights, using oauth, etc-overly-complicated-process, which is (dare-i-say) rather stupid since I don't want to authenticate other people, like visitors. I simply want to emulate my(self|browser), as if I'm the one navigating through their pages and not an automated tool. Of course I could probably go the cURL way and emulate a real user-agent but I'm not about to start scraping FB pages.

有没有使用验证一个简单的用户名/密码(甚至没有存储在服务器上),以FB并获得同样的权利我通过浏览器进行身份验证时通常会得到一种编程方法?当然,获得一个JSON或其他机器语法分析封装所需的数据?我假设我需要发送的cookie或某种形式的susequent请求令牌,但是这不是问题,我只需要一个简单的用户身份验证的方法/通过,并绕过整个应用程序的注册疼痛。

Is there a programmatic way of authenticating to FB using a simple user/pass (not even stored on the server) and get the same rights I normally get when authenticating through a browser? And of course, obtain needed data in a json or other machine parse-able encapsulation ? I would assume I need to send a cookie or some form of token on susequent requests, but that's not a problem, I just need a way of authenticating with a simple user/pass and bypass that whole app registration ache.

我需要类似的东西到Twitter和Google +可能(?)我没有找到微博,但没有对谷歌+(同样的问题,微博正努力为他们创造一个应用程序,并使用OAuth的方式,但一个简单的类做维护通过简单的REST请求验证作为自己的一种方式)。

I'd need something similar to twitter and google+ maybe (?) I did find a simple class for twitter but nothing on google+ (same problem, twitter is pushing hard for their way of creating an app and using oauth, but they do maintain a way of authenticating as yourself through simple REST requests).

推荐答案

我不相信有办法做你所描述的东西,比模拟一个用户代理的痛苦和不支持的方法等。这也是不是一个好的做法做你所描述的东西,如Facebook(和其他网站为此事)不应该允许第三方收集用户名/密码,即使它只是在运输途中。据我所知,在你的场景中,你将是唯一的用户,但Facebook有设计自己的API为广大人民群众。

I don't believe there is a way to do what you're describing, other than a painful and non-supported method of emulating a user agent. It's also not a good practice to do what you're describing, as Facebook (and other websites for that matter) should not allow 3rd parties to collect usernames/passwords, even if it's only in transit. I understand that in your scenario, you will be the only user, but Facebook has to design their API for the masses.

为什么不建立一个Facebook应用程序,并使用OAuth?你只需要授权您的应用程序一次,得到的离线访问令牌,然后使用该访问令牌从那时起。我认为这将是比你要寻找的,因为你不需要每次与Facebook进行身份验证的方法更容易。你只需要访问令牌。

Why not set up a Facebook App and use oauth? You'll only need to authorize your App once, get an offline access token, and then use that access token from then on. I think this will be easier than the approach you're looking for because you won't need to authenticate with Facebook every time. You just need the access token.

请注意,如果你改变你的Facebook密码或取消授权您的应用程序脱机访问令牌将到期。

Note that the offline access token will expire if you change your Facebook password or you de-authorize your app.

这篇关于使用用户名/密码登录编程方式向Facebook的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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