Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / March 2006

Tip: Looking for answers? Try searching our database.

Login to Google Accounts via Java

Thread view: 
edmccann@gmail.com - 06 Mar 2006 00:24 GMT
Hello,

I'm trying to write a program that requires me to log in to my Google
Account via Java, however, after playing around with HttpURLConnection
and such it's still not working.  Has anyone done this or know where I
can find info on it?

Thanks,
Ed
Roedy Green - 06 Mar 2006 01:39 GMT
>I'm trying to write a program that requires me to log in to my Google
>Account via Java, however, after playing around with HttpURLConnection
>and such it's still not working.  Has anyone done this or know where I
>can find info on it?

see http://mindprod.com/applets/fileio.html

It will show you how to do a GET via raw sockets or HTTP
Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.

lewmania942@yahoo.fr - 06 Mar 2006 01:45 GMT
> I'm trying to write a program that requires me to log in to my Google
> Account via Java, however, after playing around with HttpURLConnection
> and such it's still not working.  Has anyone done this or know where I
> can find info on it?

First, depending on what you need to do, there may be
a Google API providing you a clean abstraction, removing
the need to hack with HttpURLConnection.

Quite some time ago I wrote some program to automagically
check Usenet's archives through groups.google.com.  Google
was not providing any API for groups.google.gom at that
time (I don't know if they do know).

To make it work, I had to fake the headers.  I think
it is especially forbidden by Google to do so, so you may
end up doing something illegal.

Here's a sample of a fake User-Agent header that I must
have grabbed on the net (I don't remember, but it looks
like a "german Windows" Firefox header while I'm not
german and... using Linux since years ;)

My program is still working fine today with that fake User-Agent:

   final URLConnection urlCon = url.openConnection();
   urlCon.setRequestProperty("User-Agent", "Mozilla/5.0 (Windows; U;
Windows NT 5.1; de-DE; rv:1.6) Gecko/20040206 Firefox/0.8");

Now, I never tried to actually log into Google using
a Google account.

They may have some protection measure preventing this.

If Yahoo! suspect that you're using a "robot" for example, they'll
present you a nice "captcha".  Google /might/ be doing the same
if they think they're detecting a robot (I don't say to do, but they
very well could, just like Yahoo!).  Which is why my program used
some randomization/delays/etc. to make it like it wasn't a robot.

It remind me of this quote:

A program designed for inputs from people is usually
stressed beyond breaking point by computer-generated
inputs. -- Dennis Ritchie

But I'm not sure one would really manage to stress Google's
200.000 servers farm ;)

Hope it helps,
jcc - 06 Mar 2006 11:03 GMT
pls check the link below
http://code.google.com/apis.html#gmail


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.