Google Account + PHP

How could i login into google account with username and password programatically without entering into login page
Who is Participating?
HackneyCabConnect With a Mentor Commented:
Google have their OAuth API described here:

I decided against using it because it requires that your Google Accounts admin username and password be embedded within your source code, which seems risky to me (I'm on shared web hosting).

I did ask Google whether it's possible to create a read-only account that can simply query, say, Analytics data, without any admin access (such as changing email address, settings, etc). Google never did reply to that question.
curl functions in php which allows you to do something like that
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Ray PaseurCommented:
Before you spend too much time trying to do this with CURL (possible in theory, unlikely in practice) please contact Google and get written permission to access their web services this way.  For some of the services an API key is used.  Others are public and require no keys.

The central issue here is whether Google, as owner of the service and data, endorses your desired method of access.  If they do, you will find them very helpful in creating the tools you need to get at the data.  If they do not, they will tell you and you will have saved yourself from a lot of technical frustration and a legal nightmare.

Best of luck with your project, ~Ray
Ray PaseurCommented:
@HackneyCab: that's a great suggestion.  I believe that Twitter is going to use OAuth, too.

I use shared web hosting for lots of things and have not yet run into any issue with compromised passwords.  If you trust your web host to keep your data base, you kind of have already trusted them with something pretty important.  So I just keep my passwords out of the web root and live with that level of risk.
vineethvpAuthor Commented:
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.