Ok, I made the changes and it works...

Thanks!

On Mar 31, 2:09 am, "Alex (Google)" <[EMAIL PROTECTED]> wrote:
> Hi Carlos,
>
> The GoogleService class (superclass of UserService) has a method which
> takes the CAPTCHA logintoken and logincaptcha parameters:
>
> http://code.google.com/p/gdata-java-client/source/browse/trunk/java/s...
>
> You would need to modify AppsForYourDomainClient:
>
> http://code.google.com/p/gdata-java-client/source/browse/trunk/java/s...
>
> -alex
>
> On Mar 29, 7:12 pm, Cuso <[EMAIL PROTECTED]> wrote:
>
> > I am wondering if there is any support of the JAVA client library to
> > respond to CAPTCHA challenges.  Are you planning on incorporating this
> > into the library?
>
> > If there isn't any support for this, it would mean that the need to
> > support challenges prevents us from using the library, since there is
> > no way to supply the token to the library objects (e.g UserService)
> > once the challenge is resolved by code outside the library.
>
> > I've tried the following code to unlock several captchas without any
> > luck.  Can you point out any reason why this would result in a 403
> > code response?
>
> >             String body = "source=gdata-sample-AppsForYourDomain-
> > UserService&accountType=HOSTED&Email="+usernameAndDomain
> > +"&Passwd="+password+"&logintoken="+loginToken+"&logincaptcha="+
> > loginCaptcha;
> >             URL u = new URL("https://www.google.com/accounts/
> > ClientLogin");
> >             HttpURLConnection con = (HttpURLConnection)
> > u.openConnection();
> >             con.addRequestProperty("Content-type", "application/x-www-
> > form-urlencoded");
> >             con.setRequestMethod("POST");
> >             con.setDoOutput(true);
> >             con.connect();
> >             OutputStream os = con.getOutputStream();
> >             os.write(body.getBytes);
> >             response = con.getResponseMessage();
>
> > I've also tried changing each of:
>
> > 1)"service=xapi&..."
> > 2) "service=apps&..."
> > 3) with no source parameter
> > 4) several different captchas
> > 5) without setting the request property
>
> > The following is one of the many logintoken/logincaptcha combination
> > I've tried:
>
> > logintoken=LWcb6UquDMEq_0Creoj8PyM9OEXLqjpnehVdjPsxpM30jM8IpfFD0g0G3ROyXKZvB0usPRbK9U5FNGwv9Up8cpMM097rOycHgSMfu4jPyZQ:
> > 0chsoEwmB_Oge-xdMnwRIg
>
> > logincaptcha=cation
>
> > In all cases, the condition where a captcha was required was caused by
> > using the Java client library to login several times to the same
> > account until an CaptchaRequiredException was thrown.  I am guessing
> > the cause of the problem might be due to differences in the values the
> > client library uses for some of the parameters and the values my code
> > uses.
>
> > Thanks in advance!
> > Carlos
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Apps APIs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/google-apps-apis?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to