Login to Google Accounts via Java

Discussion in 'Java' started by edmccann@gmail.com, Mar 6, 2006.

  1. Guest

    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
     
    , Mar 6, 2006
    #1
    1. Advertising

  2. Roedy Green Guest

    On 5 Mar 2006 16:24:03 -0800, wrote, quoted or
    indirectly quoted someone who said :

    >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
    --
    Canadian Mind Products, Roedy Green.
    http://mindprod.com Java custom programming, consulting and coaching.
     
    Roedy Green, Mar 6, 2006
    #2
    1. Advertising

  3. Guest

    > 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,
     
    , Mar 6, 2006
    #3
  4. jcc Guest

    jcc, Mar 6, 2006
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Samuel Shum

    Manage User Accounts via asp.net

    Samuel Shum, Jun 23, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    500
    M. Zeeshan Mustafa
    Jun 23, 2004
  2. Andrew Thompson

    FAQ - references to Google/Google Groups

    Andrew Thompson, Jun 20, 2005, in forum: Java
    Replies:
    0
    Views:
    629
    Andrew Thompson
    Jun 20, 2005
  3. Replies:
    2
    Views:
    2,036
    Jeffrey Schwab
    Nov 28, 2005
  4. Krice
    Replies:
    9
    Views:
    295
    Default User
    Apr 25, 2008
  5. PL

    Forms login and expired accounts !

    PL, Feb 13, 2005, in forum: ASP .Net Security
    Replies:
    3
    Views:
    117
Loading...

Share This Page