It's all about the answers!

Ask a question

OpenSocial gadget added to the jts dashboards does not work


Krzysztof Daniel (5163) | asked Feb 11 '11, 7:15 a.m.
I have a gadget with refers to the service from my app running on 9444.
Putting the gadhet in the dashboards gives following result:

XHR finished loading: "https://localhost:9443/jts/web/services/makeRequest".

throw 1; <don>{"https://localhost:9444/support/retainqueuelist":{"oauthErrorText":"Not allowed due to security","oauthError":true}}

How can I workaround this?

11 answers



permanent link
Randy Hudson (216142) | answered Feb 11 '11, 1:37 p.m.
FORUM MODERATOR / JAZZ DEVELOPER
Please provide more information

permanent link
Krzysztof Daniel (5163) | answered Feb 12 '11, 1:35 p.m.
I have written a dojo module which access the REST service https://localhost:9444/support/retainqueuelist. This works fine if the widget is used in the application running on port 9444.
Then I created an opensocial widget which embedds the dojo module, and I got the error, it is possibly because the jfs dashboards run on port 9443. What details more do you need?

permanent link
Randy Hudson (216142) | answered Feb 23 '11, 11:38 a.m.
FORUM MODERATOR / JAZZ DEVELOPER
I have written a dojo module which access the REST service https://localhost:9444/support/retainqueuelist. This works fine if the widget is used in the application running on port 9444.
Then I created an opensocial widget which embedds the dojo module, and I got the error, it is possibly because the jfs dashboards run on port 9443. What details more do you need?


How does your gadget load its dojo module(s)? Are you using the jazz web infrastructure? What does your code look like that invokes makeRequest?

permanent link
Krzysztof Daniel (5163) | answered Feb 24 '11, 6:01 a.m.

How does your gadget load its dojo module(s)? Are you using the jazz web infrastructure? What does your code look like that invokes makeRequest?


Randy,
The widget is very simple:

<?xml version="1.0" encoding="UTF-8"?>

<Module>
<ModulePrefs title="Title"/>
<Content type="html" href="https://localhost:9444/support/app">
</Module>


Under https://localhost:9444/support/app there is a regular dojo module which calls jazz.client.xhrGet to get the data from https://localhost:9444/support/retainqueuelist.

Small debugging revealed that in

JazzOAuthConsumerService.doSend(HttpRequest, GadgetContext) line: 93
JazzOAuthConsumerService.send(HttpRequest, GadgetContext) line: 142
MakeRequestServlet.doGet(HttpServletRequest, HttpServletResponse) line: 69
MakeRequestServlet.doPost(HttpServletRequest, HttpServletResponse) line: 108


JazzHttpClient.allow(request, context)
returns false, because
FriendsConfig.getFriendsConfig().getFriendMatchForOauthDomain(uri)
returns null.

This looks pretty much like a wrong friends configuration.
My application looks like it was registered correctly (there are entries in Registered Applications and in Consumer (Inbound). I also doubt if there is something wrong with JFS itself, so maybe it is my application configuration.
My rootservices are:

<rdf:RDF>
<ju:widgetCatalog rdf:resource="https://localhost:9444/support/WidgetCatalog"/>
<jd:friends rdf:resource="https://localhost:9444/support/friends"/>
</rdf:RDF>

My friends are :

<rdf:RDF>
<jd:Friend>
<dc:title xml:lang="en">JTS</dc:title>
<jd:rootServices rdf:resource="https://localhost:9443/jts/rootservices"/>
<jfs:internal>false</jfs:internal>
<jfs:oauthConsumerSecret>changeme</jfs:oauthConsumerSecret>
<jfs:oauthConsumerKey>changemetoo</jfs:oauthConsumerKey>
<jfs:oauthDomain>https://localhost:9443/jts/</jfs:oauthDomain>
</jd:Friend>
</rdf:RDF>


Is there something that I've missed?

permanent link
Randy Hudson (216142) | answered Feb 24 '11, 5:06 p.m.
FORUM MODERATOR / JAZZ DEVELOPER
Small debugging revealed that in

JazzOAuthConsumerService.doSend(HttpRequest, GadgetContext) line: 93
JazzOAuthConsumerService.send(HttpRequest, GadgetContext) line: 142
MakeRequestServlet.doGet(HttpServletRequest, HttpServletResponse) line: 69
MakeRequestServlet.doPost(HttpServletRequest, HttpServletResponse) line: 108



Were you debugging the JTS? Subject says the gadget was added to a JTS dashboard.

JazzHttpClient.allow(request, context)

returns false, because
FriendsConfig.getFriendsConfig().getFriendMatchForOauthDomain(uri)
returns null.


If your gadget is being rendered on the JTS, then we should looking at the JTS's friends, not your App's friends. Your gadget needs to communicate back to :9444/support from :9443/jts, right?

permanent link
Krzysztof Daniel (5163) | answered Feb 25 '11, 1:52 a.m.

Were you debugging the JTS? Subject says the gadget was added to a JTS dashboard.

Yep. Using remote debug.

If your gadget is being rendered on the JTS, then we should looking at the JTS's friends, not your App's friends. Your gadget needs to communicate back to :9444/support from :9443/jts, right?

I am no expert in making friends ;-). I get your point, but I am still not convinced who to blame. Maybe my app (:9444/support) should expose something via rootservices...

permanent link
Randy Hudson (216142) | answered Feb 25 '11, 12:08 p.m.
FORUM MODERATOR / JAZZ DEVELOPER

JazzHttpClient.allow(request, context)
returns false, because
FriendsConfig.getFriendsConfig().getFriendMatchForOauthDomain(uri)
returns null.


What was the uri? Are you sure it was 9444/support/?

permanent link
Krzysztof Daniel (5163) | answered Feb 28 '11, 9:40 a.m.
Screenshots:
http://img576.imageshack.us/img576/959/widgetdebug.png

Note that the oauthDomainURIs list is empty.
http://img809.imageshack.us/img809/6706/widgetdebug2.png

permanent link
Randy Hudson (216142) | answered Feb 28 '11, 10:09 a.m.
FORUM MODERATOR / JAZZ DEVELOPER
Seems like FriendEx would be violating some invariant to not have any oauth domains.

permanent link
Krzysztof Daniel (5163) | answered Mar 03 '11, 4:05 a.m.
Seems like FriendEx would be violating some invariant to not have any oauth domains.


I have overcome this problem. Entries were missing in rootservices. Now I get other error:

throw 1; < don't be evil' >{"https://localhost:9444/support/retainqueuelist":{"rc":401,"body":"{\n \"detailedMessage\": \"Authorization information is missing\",\n \"errorMessage\": \"unaothorized user\",\n \"errorStatus\": \"401\"\n}","headers":{}}}

How should I proceed?

Your answer


Register or to post your answer.