of gadgets.io.makeRequest() and it still didn't work, so I moved on to
trying AuthSub and that worked. If anyone is interested in finding out
how to get AuthSub working with the Blogger API in a Blogger gadget,
this resource: http://wiki.opensocial.org/index.php?title=Leveraging_Google_Data_APIs_in_OpenSocial_Apps
proved to be valuable--the only major changes that I had to make were
to use encodeURIComponent() instead of escape() (and their inverses),
and to change the structure of the token cookies from the one used in
that wiki to: document.cookie = "g314-scope-0=scope=" +
encodeURIComponent(scope) + "&token=" + encodeURIComponent(token)
Of course, you can simply use google.accounts.user.login() as
described in all the official literature, but that is quite difficult
to make work in a Blogger gadget because when the "next" URI is moved
to in the browser after authentication, you lose the blog and are
returned to a full page gadget. If you try going back in your browser
history, the gadget reloads under a different random URI causing the
token you just activated to be worthless. That is why the wiki above
is very useful, because you can avoid the hassle by creating a pop-up
window using AuthSubRequest instead, which doesn't appear possible
using google.accounts.user.login().
I'm really happy about this because ever since I started working on my
Blogger gadget I have heard on the help forum that private blogs have
their feeds disabled. That is definitely not the case, however. We
just needed a way to authenticate the person requesting those feeds,
and AuthSub looks like the way to go for Blogger gadgets.
--Aratina
On Nov 16, 12:22 am, Aratina Cage <aratina.c...@gmail.com> wrote:
> Thank you for the quick response, Brett. I will keep trying different
> things, then, and I will have a look at that feature inspector
> gadget.
>
> (Also a quick correction to my post above, I misspelled Eric
> Bidelman's name--apologies!)
>
> --Aratina
>
> On Nov 16, 12:02 am, Brett Morgan <brettmor...@google.com> wrote:
>
>
>
>
>
>
>
> > Aratina,
>
> > I'm currently learning this area as well, and I don't have any answers yet.
>
> > An interesting point to note, however, is that you aren't limited to just
> > opensocial-0.8. If you point blogger designer in the direction of the
> > feature inspector gadget -https://github.com/xing/feature-inspector-gadget-
> > you'll see that it supports a fair chunk of OpenSocial. (Just don't use
> > github's hosted version directly.)
>
> > brett
>
> > On Tue, Nov 16, 2010 at 3:34 PM, Aratina Cage <aratina.c...@gmail.com>wrote:
>
> > > I have been attempting to use the OAuth proxy with my Blogger gadget
> > > and also with many of the example gadgets that use the OAuth proxy in
> > > the various help files, but I can't seem to get OAuth to work on my
> > > Blogger blog. The examples I have tested all seem to work on iGoogle,
> > > but once I load them onto my blog, the authentication process fails
> > > completely.
>
> > > For example, this neat little gadget by Eric Bidelmen (
> > >http://code.google.com/apis/gdata/articles/gdata_gadgets.html) works
> > > just fine with iGoogle and allows you to make a new post to your
> > > private blog from iGoogle quite easily, but when I bring it onto the
> > > blog itself as a gadget in the sidebar or footer areas, it always gets
> > > back an unauthenticated response object with no contents after it
> > > tries to fetch the feed of all the blogs I own using the OAuth proxy.
>
> > > I don't see anything in the XML file (which you can download from the
> > > link above) that stands out as not compatible with Blogger (it
> > > requires opensocial-0.8 and loads old but working jQuery and gdata
> > > libraries, and declares the correct the Blogger scope for OAuth,
> > > "http://www.blogger.com/feeds/"), so I'm confused as to why it doesn't
> > > work. Does anyone have any ideas as to why OAuth does not work on
> > > Blogger blogs but does work from iGoogle?
>
> > > --
> > > You received this message because you are subscribed to the Google Groups
> > > "Blogger Developer Group" group.
> > > To post to this group, send email to bloggerdev@googlegroups.com.
> > > To unsubscribe from this group, send email to
> > > bloggerdev+unsubscribe@googlegroups.com<bloggerdev%2Bunsubscribe@googlegrou ps.com>
> > > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/bloggerdev?hl=en.
>
> > --
> > Brett Morgan
>
> > *Developer Programs Engineer, Blogger*
--
You received this message because you are subscribed to the Google Groups "Blogger Developer Group" group.
To post to this group, send email to bloggerdev@googlegroups.com.
To unsubscribe from this group, send email to bloggerdev+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/bloggerdev?hl=en.
No comments:
Post a Comment