开发者

Login to Gmail Inbox using Curl?

开发者 https://www.devze.com 2022-12-26 17:37 出处:网络
I\'m doing a project where user will first save his gmail id and password and after confirmation,I will provide a link for directly login to gmail next time without entering his gmail id and password.

I'm doing a project where user will first save his gmail id and password and after confirmation,I will provide a link for directly login to gmail next time without entering his gmail id and password.. the saved password will passed as a parameters of userid and passwd using CURL

I'm doing this using php.. I heard about curl to do this.. I tried lots of code but didn't get 开发者_如何学Pythonany working code.. Can anyone tell me.. how do i just login to gmail inbox .. using CURL in PHP ??


If you're just interested in reading the emails in a Gmail inbox you should forgo the cURL pseudo-browser path; instead, enable POP or IMAP on the Gmail account and use PHP's excellent IMAP/POP3 functions to access the Gmail inbox.

If on the other hand you're trying to create some sort of single-sign-on service you're straight out of luck. Why is this? Well, even if your server manages to authenticate and persist cookies from Gmail, you have no way of storing these Gmail cookies in the client's browser. Only requests that originate from mail.google.com can set Gmail cookies. This is known as Same origin policy.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号