Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

OpenSocial gadget added to the jts dashboards does not work

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?

0 votes



11 answers

Permanent link
Please provide more information

0 votes


Permanent link
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?

0 votes


Permanent link
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?

0 votes


Permanent link

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?

0 votes


Permanent link
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?

0 votes


Permanent link

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...

0 votes


Permanent link

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


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

0 votes


Permanent link
Screenshots:
http://img576.imageshack.us/img576/959/widgetdebug.png

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

0 votes


Permanent link
Seems like FriendEx would be violating some invariant to not have any oauth domains.

0 votes


Permanent link
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?

0 votes

1–15 items
page 1of 1 pagesof 2 pages

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,941

Question asked: Feb 11 '11, 7:15 a.m.

Question was seen: 9,911 times

Last updated: Feb 11 '11, 7:15 a.m.

Confirmation Cancel Confirm