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?
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
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?
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?
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?
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
returns false, because
JazzHttpClient.allow(request, context)
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?
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, becauseFriendsConfig.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?
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...
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?
page 1of 1 pagesof 2 pages