Can you run this sample? http://code.google.com/apis/blogger/docs/1.0/developers_guide_js.html#Interactive_Samples
On Mon, May 25, 2009 at 11:29 AM, noGGin <lawrenc...@gmail.com> wrote: > > Here is my code pulled from my test page: > > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http:// > www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> > <html xmlns="http://www.w3.org/1999/xhtml"> > <head> > <meta http-equiv="content-type" content="text/html; charset=utf-8"/ > > > <title>My Google Data API Application</title> > <script src="http://www.google.com/jsapi? > key=ABQIAAAAMckdzp79H9T72-3yHiv- > BRQBnJMNXV2JFGJdzYopxFXhdLLc0RRJkNyWywXhm8h-gZVIaxK4uLg69Q" type="text/ > javascript"></script> > <script type="text/javascript"> > //<![CDATA[ > > google.load("gdata", "1.x"); > google.setOnLoadCallback(initializePage); > > function initializePage() { > var scope = "http://www.blogger.com/feeds/"; > if (google.accounts.user.checkLogin(scope)) { > var service = new google.gdata.BloggerService('lawrence79- > TestApp-v1.0'); > alert("here"); > } else { > var token = google.accounts.user.login(scope); > } > } > > //]]> > </script> > </head> > <body> > <div id="panel"/> > </body> > </html> > > I tried to display a simple alert after login but I get the > neverending access request loop. I am not blocking cookies. I've also > tried with and without the api key on my domain. I've also tried it on > my localhost. I'm not sure what I'm doing wrong. > > On May 25, 11:04 am, Eric Bidelman <api.e...@google.com> wrote: > > Hi guys, > > Try setting up your page as follows: > http://gdatatips.blogspot.com/2008/12/using-javascript-client-library... > > > > 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.. > .> > > 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 -~----------~----~----~----~------~----~------~--~---