You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@shindig.apache.org by Martin Hoeller <ma...@xss.co.at> on 2012/11/07 10:42:56 UTC

How to render a gadget with oauth the proper way (including security_token)

Hi!

I'm having a hard time to learn shindig and could need some help.

I integrated shindig in our existing webapp an am able to render basic
gadgets. The code I use for rendering gadgets is basicaly what you find
here:
https://fisheye6.atlassian.com/browse/shindig/trunk/java/sample-maven-archetype/src/main/resources/archetype-resources/src/main/webapp/index.html?r=1403455

Now I want to make data requests to the existing webapp. The relevant
code for doing this is taken from
https://developers.google.com/gadgets/docs/oauth#sample

As long as I set AUTHORIZATION to NONE it works and I can receive data.
However, as soon as I set it to use OAUTH, I get a 400 (Bad
Request) response from the server. Analysis showed, that the actual
error is, that the SECURITY_TOKEN request attribute is not set. So I
assume I have to provide the token somehow.

Could someone enlighten me what I'm missing here, please.

Many thanks in advance,
- martin

RE: How to render a gadget with oauth the proper way (including security_token)

Posted by "Olumee, Milan" <Mi...@solers.com>.
Can you please unsubscribe me from this group...

Thanks

-----Original Message-----
From: Martin Hoeller [mailto:martin@xss.co.at] 
Sent: Friday, November 09, 2012 2:35 AM
To: users@shindig.apache.org
Subject: Re: How to render a gadget with oauth the proper way (including security_token)

Hi!

On 08 Nov 2012, Ryan Baxter wrote:

> The first thing I would recommend doing is moving to the common 
> container to help with your container implementation.  See the common 
> container sample application [1].

The code I currently use was taken from some examples comming with shindig. And I couldn't find a note saying it's deprecated. If this is the case, I suggest mentioning it somewhere.

This said, I'd be happy to switch to common container if I'd only knew how. I already had a look at the sources of commoncontainer/index.html.
However, the only relevant JavaScript I could find was CommonContainer.init(). Is there some documentation available? How does the CommonContainer know where to put the gadgets? And how do I tell it which gadgets to display?

Many thanks for your help,
- martin

Re: How to render a gadget with oauth the proper way (including security_token)

Posted by Ryan Baxter <rb...@apache.org>.
Thanks.  We plan on updating the samples before we release 2.5.


On Mon, Nov 12, 2012 at 4:25 AM, Martin Hoeller <ma...@xss.co.at> wrote:

> On Fri, 9 Nov 2012 19:27:29 -0500 Ryan Baxter <rb...@gmail.com> wrote:
>
> > Here is a simpler example:
> >
> https://github.com/ryanjbaxter/OpenSocial-Presentation/blob/master/slidecontainer/content/slidecontainer/js/container.js
>
> Thanks Ryan. That's a very good (and up-to-date) example. It shuld be
> listed on Shindig's documentation page.
>
> - martin
>

Re: How to render a gadget with oauth the proper way (including security_token)

Posted by Ryan Baxter <rb...@apache.org>.
Thanks.  We plan on updating the samples before we release 2.5.


On Mon, Nov 12, 2012 at 4:25 AM, Martin Hoeller <ma...@xss.co.at> wrote:

> On Fri, 9 Nov 2012 19:27:29 -0500 Ryan Baxter <rb...@gmail.com> wrote:
>
> > Here is a simpler example:
> >
> https://github.com/ryanjbaxter/OpenSocial-Presentation/blob/master/slidecontainer/content/slidecontainer/js/container.js
>
> Thanks Ryan. That's a very good (and up-to-date) example. It shuld be
> listed on Shindig's documentation page.
>
> - martin
>

Re: How to render a gadget with oauth the proper way (including security_token)

Posted by Martin Hoeller <ma...@xss.co.at>.
On Fri, 9 Nov 2012 19:27:29 -0500 Ryan Baxter <rb...@gmail.com> wrote:

> Here is a simpler example:
> https://github.com/ryanjbaxter/OpenSocial-Presentation/blob/master/slidecontainer/content/slidecontainer/js/container.js

Thanks Ryan. That's a very good (and up-to-date) example. It shuld be
listed on Shindig's documentation page.

- martin

Re: How to render a gadget with oauth the proper way (including security_token)

Posted by Martin Hoeller <ma...@xss.co.at>.
On Fri, 9 Nov 2012 19:27:29 -0500 Ryan Baxter <rb...@gmail.com> wrote:

> Here is a simpler example:
> https://github.com/ryanjbaxter/OpenSocial-Presentation/blob/master/slidecontainer/content/slidecontainer/js/container.js

Thanks Ryan. That's a very good (and up-to-date) example. It shuld be
listed on Shindig's documentation page.

- martin

Re: How to render a gadget with oauth the proper way (including security_token)

Posted by Ryan Baxter <rb...@gmail.com>.
Here is a simpler example:
https://github.com/ryanjbaxter/OpenSocial-Presentation/blob/master/slidecontainer/content/slidecontainer/js/container.js

The navigateGadget API is the API you can use to render a gadget in the
container.


On Fri, Nov 9, 2012 at 2:34 AM, Martin Hoeller <ma...@xss.co.at> wrote:

> Hi!
>
> On 08 Nov 2012, Ryan Baxter wrote:
>
> > The first thing I would recommend doing is moving to the common container
> > to help with your container implementation.  See the common container
> > sample application [1].
>
> The code I currently use was taken from some examples comming with
> shindig. And I couldn't find a note saying it's deprecated. If this is
> the case, I suggest mentioning it somewhere.
>
> This said, I'd be happy to switch to common container if I'd only knew
> how. I already had a look at the sources of commoncontainer/index.html.
> However, the only relevant JavaScript I could find was
> CommonContainer.init(). Is there some documentation available? How does
> the CommonContainer know where to put the gadgets? And how do I tell it
> which gadgets to display?
>
> Many thanks for your help,
> - martin
>

Re: How to render a gadget with oauth the proper way (including security_token)

Posted by Ryan Baxter <rb...@gmail.com>.
Here is a simpler example:
https://github.com/ryanjbaxter/OpenSocial-Presentation/blob/master/slidecontainer/content/slidecontainer/js/container.js

The navigateGadget API is the API you can use to render a gadget in the
container.


On Fri, Nov 9, 2012 at 2:34 AM, Martin Hoeller <ma...@xss.co.at> wrote:

> Hi!
>
> On 08 Nov 2012, Ryan Baxter wrote:
>
> > The first thing I would recommend doing is moving to the common container
> > to help with your container implementation.  See the common container
> > sample application [1].
>
> The code I currently use was taken from some examples comming with
> shindig. And I couldn't find a note saying it's deprecated. If this is
> the case, I suggest mentioning it somewhere.
>
> This said, I'd be happy to switch to common container if I'd only knew
> how. I already had a look at the sources of commoncontainer/index.html.
> However, the only relevant JavaScript I could find was
> CommonContainer.init(). Is there some documentation available? How does
> the CommonContainer know where to put the gadgets? And how do I tell it
> which gadgets to display?
>
> Many thanks for your help,
> - martin
>

Re: How to render a gadget with oauth the proper way (including security_token)

Posted by Martin Hoeller <ma...@xss.co.at>.
Hi!

On 08 Nov 2012, Ryan Baxter wrote:

> The first thing I would recommend doing is moving to the common container
> to help with your container implementation.  See the common container
> sample application [1].

The code I currently use was taken from some examples comming with
shindig. And I couldn't find a note saying it's deprecated. If this is
the case, I suggest mentioning it somewhere.

This said, I'd be happy to switch to common container if I'd only knew
how. I already had a look at the sources of commoncontainer/index.html.
However, the only relevant JavaScript I could find was
CommonContainer.init(). Is there some documentation available? How does
the CommonContainer know where to put the gadgets? And how do I tell it
which gadgets to display?

Many thanks for your help,
- martin

Re: How to render a gadget with oauth the proper way (including security_token)

Posted by Ryan Baxter <rb...@apache.org>.
The first thing I would recommend doing is moving to the common container
to help with your container implementation.  See the common container
sample application [1].

[1] http://shindig.apache.org/about_shindig_getting_started.html


On Thu, Nov 8, 2012 at 6:13 AM, Martin Hoeller <ma...@xss.co.at> wrote:

> On 07 Nov 2012, Ryan Baxter wrote:
>
> > Martin what version of Shindig are you using?
>
> 2.5.0-beta4
>
>
> - martin
>
> > On Wed, Nov 7, 2012 at 4:42 AM, Martin Hoeller <ma...@xss.co.at> wrote:
> >
> > > Hi!
> > >
> > > I'm having a hard time to learn shindig and could need some help.
> > >
> > > I integrated shindig in our existing webapp an am able to render basic
> > > gadgets. The code I use for rendering gadgets is basicaly what you find
> > > here:
> > >
> > >
> https://fisheye6.atlassian.com/browse/shindig/trunk/java/sample-maven-archetype/src/main/resources/archetype-resources/src/main/webapp/index.html?r=1403455
> > >
> > > Now I want to make data requests to the existing webapp. The relevant
> > > code for doing this is taken from
> > > https://developers.google.com/gadgets/docs/oauth#sample
> > >
> > > As long as I set AUTHORIZATION to NONE it works and I can receive data.
> > > However, as soon as I set it to use OAUTH, I get a 400 (Bad
> > > Request) response from the server. Analysis showed, that the actual
> > > error is, that the SECURITY_TOKEN request attribute is not set. So I
> > > assume I have to provide the token somehow.
> > >
> > > Could someone enlighten me what I'm missing here, please.
> > >
> > > Many thanks in advance,
> > > - martin
>

Re: How to render a gadget with oauth the proper way (including security_token)

Posted by Martin Hoeller <ma...@xss.co.at>.
On 07 Nov 2012, Ryan Baxter wrote:

> Martin what version of Shindig are you using?

2.5.0-beta4


- martin

> On Wed, Nov 7, 2012 at 4:42 AM, Martin Hoeller <ma...@xss.co.at> wrote:
> 
> > Hi!
> >
> > I'm having a hard time to learn shindig and could need some help.
> >
> > I integrated shindig in our existing webapp an am able to render basic
> > gadgets. The code I use for rendering gadgets is basicaly what you find
> > here:
> >
> > https://fisheye6.atlassian.com/browse/shindig/trunk/java/sample-maven-archetype/src/main/resources/archetype-resources/src/main/webapp/index.html?r=1403455
> >
> > Now I want to make data requests to the existing webapp. The relevant
> > code for doing this is taken from
> > https://developers.google.com/gadgets/docs/oauth#sample
> >
> > As long as I set AUTHORIZATION to NONE it works and I can receive data.
> > However, as soon as I set it to use OAUTH, I get a 400 (Bad
> > Request) response from the server. Analysis showed, that the actual
> > error is, that the SECURITY_TOKEN request attribute is not set. So I
> > assume I have to provide the token somehow.
> >
> > Could someone enlighten me what I'm missing here, please.
> >
> > Many thanks in advance,
> > - martin

Re: How to render a gadget with oauth the proper way (including security_token)

Posted by Ryan Baxter <rb...@apache.org>.
Martin what version of Shindig are you using?


On Wed, Nov 7, 2012 at 4:42 AM, Martin Hoeller <ma...@xss.co.at> wrote:

> Hi!
>
> I'm having a hard time to learn shindig and could need some help.
>
> I integrated shindig in our existing webapp an am able to render basic
> gadgets. The code I use for rendering gadgets is basicaly what you find
> here:
>
> https://fisheye6.atlassian.com/browse/shindig/trunk/java/sample-maven-archetype/src/main/resources/archetype-resources/src/main/webapp/index.html?r=1403455
>
> Now I want to make data requests to the existing webapp. The relevant
> code for doing this is taken from
> https://developers.google.com/gadgets/docs/oauth#sample
>
> As long as I set AUTHORIZATION to NONE it works and I can receive data.
> However, as soon as I set it to use OAUTH, I get a 400 (Bad
> Request) response from the server. Analysis showed, that the actual
> error is, that the SECURITY_TOKEN request attribute is not set. So I
> assume I have to provide the token somehow.
>
> Could someone enlighten me what I'm missing here, please.
>
> Many thanks in advance,
> - martin
>

Re: How to render a gadget with oauth the proper way (including security_token)

Posted by Ryan Baxter <rb...@apache.org>.
Martin what version of Shindig are you using?


On Wed, Nov 7, 2012 at 4:42 AM, Martin Hoeller <ma...@xss.co.at> wrote:

> Hi!
>
> I'm having a hard time to learn shindig and could need some help.
>
> I integrated shindig in our existing webapp an am able to render basic
> gadgets. The code I use for rendering gadgets is basicaly what you find
> here:
>
> https://fisheye6.atlassian.com/browse/shindig/trunk/java/sample-maven-archetype/src/main/resources/archetype-resources/src/main/webapp/index.html?r=1403455
>
> Now I want to make data requests to the existing webapp. The relevant
> code for doing this is taken from
> https://developers.google.com/gadgets/docs/oauth#sample
>
> As long as I set AUTHORIZATION to NONE it works and I can receive data.
> However, as soon as I set it to use OAUTH, I get a 400 (Bad
> Request) response from the server. Analysis showed, that the actual
> error is, that the SECURITY_TOKEN request attribute is not set. So I
> assume I have to provide the token somehow.
>
> Could someone enlighten me what I'm missing here, please.
>
> Many thanks in advance,
> - martin
>