OAuth integration with Twitter

1 view
Skip to first unread message

Pablo Fernandez

unread,
Jul 6, 2009, 3:11:12 PM7/6/09
to OpenSocial - OpenSocial Application Development
Hi, I'm developing a simple gadget that interacts with the Twitter
API, it uses oauth to authenticate with the service provider (twitter
servers).

here's the code for the gadget via pastie: http://pastie.org/536055

I put a breakpoint in firebug to see the result, but twitter servers
throw a 403 (unauthorized) response....

What am I doing wrong?

Julian Doherty

unread,
Jul 6, 2009, 6:57:35 PM7/6/09
to opensoc...@googlegroups.com
What container are you deploying the gadget to, and have you set up the consumer key/secret from twitter with the container?

The container needs the credentials as it will make requests to twitter on your behalf. The way that you get the credentials in there varies from container to container.

Cheers
Julian Doherty

2009/7/7 Pablo Fernandez <fernande...@gmail.com>

pablo fernandez

unread,
Jul 6, 2009, 7:05:20 PM7/6/09
to opensoc...@googlegroups.com
Julian,

I tried to adapt this example from opensocial docs:


I've got the Consumer Key and Consumer Secret from twitter but following that example I don't know where to put them.

Any ideas?
--
Fernandez, Pablo.

Julian Doherty

unread,
Jul 6, 2009, 8:30:16 PM7/6/09
to opensoc...@googlegroups.com
Have a read further down in that document under the "Consumer Key and Callback URL" at http://code.google.com/intl/en/apis/gadgets/docs/oauth.html#consumer-key

Basically, you'll need to generate a twitter oauth key/secret at http://twitter.com/oauth_clients and then submit that somehow to the container where your gadget is hosted. Telling the container about the key is done outside the gadget (so as to preserve the "secret" part), so it varies from container to container. Generally they'll have a web form or email address where you can submit keys to so your gadget can use them.

Cheers
Julian Doherty

2009/7/7 pablo fernandez <fernande...@gmail.com>

pablo fernandez

unread,
Jul 7, 2009, 11:23:55 AM7/7/09
to opensoc...@googlegroups.com
Julian,

Seems like I have to send a mail to google's oauthproxy
(oauthp...@google.com)... I've done that but got no reply

Have you (or anyone in the group) done something like this? have you
registered a third party site to use with google gadgets through
oauth?

Thanks.
--
Fernandez, Pablo.

Julian Doherty

unread,
Jul 7, 2009, 8:24:47 PM7/7/09
to opensoc...@googlegroups.com
Nope. Haven't done that with google. 

I'm doing the container side coding at the moment for a different container implementation ( http://www.lonelyplanet.com/groups ). What we do is give gadget developers a page where they manage their gadget, and part of that gadget admin page is a section for adding/editing/removing oauth credentials.

(Or at least that's how we *will* do it when the code I'm working on right this second for that exact functionality gets checked in and deployed :) )

But like I said, that's container specific, so everyone will implement that in their own way.

cheers
Julian Doherty

2009/7/8 pablo fernandez <fernande...@gmail.com>

snoopdave

unread,
Jul 31, 2009, 3:51:00 PM7/31/09
to OpenSocial - OpenSocial Application Development
On Jul 7, 11:23 am, pablo fernandez <fernandezpabl...@gmail.com>
wrote:
> Seems like I have to send a mail to google's oauthproxy
> (oauthproxy...@google.com)... I've done that but got no reply
>
> Have you (or anyone in the group) done something like this? have you
> registered a third party site to use with google gadgets through
> oauth?

Did you ever get a reply?

- Dave

Reply all
Reply to author
Forward
0 new messages