Hi guys,
Try setting up your page as follows:
http://gdatatips.blogspot.com/2008/12/using-javascript-client-library-w-non.html

Basically, you need a flow like this:
google.load('gdata', '1.x');google.setOnLoadCallback(initializePage);

function initializePage() {
   var scope = 'http://www.google.com/m8/feeds/';
   if (google.accounts.user.checkLogin(scope)) {
     var service = new google.gdata.contacts.ContactsService('co-App-v1.0');
     // get data
   } else {
     // redirect to Google to get a token
     var token = google.accounts.user.login(scope); // can ignore the
returned token value
   }
}

<http://gdatatips.blogspot.com/2008/12/using-javascript-client-library-w-non.html>
Eric

On Mon, May 25, 2009 at 10:53 AM, noGGin <lawrenc...@gmail.com> wrote:

>
> I am experiencing the same functionality. Has anyone found a
> resolution?
>
> On May 10, 10:19 am, Haberkornelius <marc.haberk...@gmail.com> wrote:
> > My application is attempting to read a list of Contacts using the
> > Contacts API.  I am using the JavaScript client library at google.com/
> > jsapi.  I invoke:
> >
> > function logMeIn() {
> >       var scope = 'http://www.google.com/m8/feeds';
> >       var token = google.accounts.user.checkLogin(scope);
> >       alert('token is: ' + token);
> >       token = google.accounts.user.login(scope);
> >
> > }
> >
> > This asks me first, which Google Account would I like to use (I have
> > 2), then asks me whether to accept or deny the access request.  I
> > accept, and my browser is directed back to my page at:
> >
> > http://localhost:8000/contacts_google#2%2FT7Zr-SI3SYU6R_HJSHd8gA
> >
> > The logMeIn() function executes again, and the output is "token is:
> > " (empty string).  Then, the page is forwarded back to Google to ask
> > me which account to use, etc....it loops forever.  It seems like the
> > JS client library is not correctly parsing the token from the URI.
> > I've looked at the cookies defined for localhost, and I see one called
> > g314-pending.
> >
> > I'm currently running an application in a test environment on my
> > desktop (URL ishttp://localhost:8000), but I'm not thinking that
> > should pose a problem, unless the JS client library is hardcoded to
> > NOT support localhost.
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Data Protocol" group.
To post to this group, send email to google-help-dataapi@googlegroups.com
To unsubscribe from this group, send email to 
google-help-dataapi+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-help-dataapi?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to