Gmail / Facebook没有用户名/密码 - PHP登录标题问题 [英] Gmail/Facebook without username/password - PHP Login Header Problem

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

问题描述

我想在Gmail / Facebook /任何其他网站中建立个人登入闸道。在这个网关我输入我的主用户名和密码,然后我可以选择登录(gmail / facebook / etc)而不输入这些用户名,因为他们存储在服务器上。



我试图实现这通过使用cURL发送POST请求与标题和post在Firefox常规登录期间发送数据。



有没有人尝试过这个问题,或者想知道为什么这不起作用?



感谢。



//编辑
我认为它不工作的问题在于发送curl请求到gmail的php服务器的IP地址与我的浏览器不同,当gmail服务器的响应反馈给浏览器时,仍然无法验证。


$ b $

解决方案

或者是我使用curl发送到Gmail服务器的Cookie实际上会根据时间更改。回复我的评论cURL对您的问题是无用的。您需要使用您的服务(gmail,facebook,...)验证您的浏览器,您正在做的是验证您的脚本(或您的服务器)。



将必须使用JavaScript来完成你想要的。如果您存储服务器上的服务凭据,则在您成功登录到网页后将其发送回客户端。然后,您可以创建一个隐藏的iframe,并将src属性设置为所选服务的登录页面。加载iframe后,您可以将登录信息(用户名/密码)填入相应的字段并提交表单。一旦这完成,你应该被留在你的服务。
可能有一些其他技术,但这是第一个让人想起来的...


I want to create my own personal login gateway into Gmail/Facebook/any other site. In this gateway I enter my master username and password, then I can choose where to login (gmail/facebook/etc) without entering those usernames because they are stored on the server.

I tried to implement this by using cURL to send POST request with the headers and post data sent in Firefox during regular login. However, this doesn't work for neither facebook or gmail.

Has anyone tried this or have an idea about why this doesn't work?

Thanks.

// Edited I am thinking the problem that it doesn't work lie in the fact that the IP address of the php server which sent the curl request to gmail is different from my browser's so, when the response from the gmail server is fed back to the browser, it still cannot authenticate.

Or is that the cookie I sent using curl to Gmail server actually changes according to time.

解决方案

Based on your reply to my comment cURL is useless for your problem. You need to authenticate your browser with your services (gmail, facebook, ...), what you are doing now is authenticating your script (or your server).

You will have to use JavaScript to accomplish what you want. If you store your credentials for the services on your server, then send them back to the client once you successfully log-in into your webpage. Then you could create a hidden iframe with the "src" attribute set to the login page of the chosen service. Once the iframe loads you can fill the login information (username/password) into the appropriate fields and submit the form. Once this is complete you should be loged-in into your services. There are probably some other techniques but this is the first that springs to mind ...

这篇关于Gmail / Facebook没有用户名/密码 - PHP登录标题问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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