无需Gmail的登录凭据自动登录通过重定向的URL Gmail帐户

问题描述 投票:0回答:1

我的任务是让任何用户登录到Gmail不知道登录凭据。

我做了一个叫做网页test.php的地方我会通过的Gmail帐户的用户名和密码,并重定向到Gmail的登录网址。

经过研究,我得到这个网址..

https://accounts.google.com/ServiceLoginAuth?continue=http://mail.google.com/gmail&service=mail&[email protected]&Passwd=PASSWORD&null=Sign+in

在这里我的电子邮件被自动填充在Gmail的登录表单而不是密码。

任何人都可以......解决这个问题..或者告诉我一些其他的方式来实现它..谢谢..

php redirect gmail autologin
1个回答
0
投票
$url = 'https://www.google.com/accounts/ClientLogin';
$params = "accountType=GOOGLE&Email=".$email."&Passwd=".$password."&service=cp&source=moneymagpie"; [$email = Your from email, $password = Your form password]

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $params);

$response = curl_exec($ch);

试试这个代码。

© www.soinside.com 2019 - 2024. All rights reserved.