[
https://issues.apache.org/jira/browse/SHINDIG-35?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12566871#action_12566871
]
Martin Webb commented on SHINDIG-35:
------------------------------------
Installed the patch okay. Created the sample widget.
Created the following sample container to host the widget:
<!DOCTYPE html>
<html>
<head>
<title>Sample: settitle support</title>
<!-- default container look and feel -->
<link rel="stylesheet" href="gadgets.css">
<script type="text/javascript" src="json.js"></script>
<script type="text/javascript" src="ifpc.js"></script>
<script type="text/javascript" src="cookies.js"></script>
<script type="text/javascript" src="gadgets.js"></script>
<script type="text/javascript">
var specUrl0 =
'http://www.btinternet.com/~martin.webb/google-gadgets/oauth.xml';
function init() {
gadgets.container.layoutManager =
new gadgets.FloatLeftLayoutManager('gadget-parent');
gadgets.container.setParentUrl('ifpc_relay.html');
var gadget = gadgets.container.createGadget({specUrl: specUrl0});
gadget.setServerBase('http://localhost:9090/gadgets/');
gadgets.container.addGadget(gadget);
};
function renderGadgets() {
gadgets.container.renderGadgets();
};
</script>
</head>
<body onLoad="init();renderGadgets()">
<h2>Sample: settitle support</h2>
<div>(Requires a Shindig server running at http://localhost:9090)</div>
<div id="gadget-parent" class="gadgets-gadget-parent"></div>
</body>
</html>
Pasted the sillyauthgadet.js into the form and then submit:
Error: data has no properties
Source File:
http://localhost:9090/gadgets/ifr?url=http%3A%2F%2Fwww.btinternet.com%2F~martin.webb%2Fgoogle-gadgets%2Foauth.xml&synd=gadgets&mid=0&parent=http%3A%2F%2Flocalhost%3A9090%2Fgadgets%2Fcontainer%2Fifpc_relay.html%3F&ogc=localhost:9090
Line: 805
Is the shindig instance supposed to be running on the same host/port as the
oauth-provider? I guess because its a proxy implementation it does not matter?
But, is there a real implementation of (other than a proxy?):
http://localhost:9090/oauth-provider/echo
http://localhost:9090/oauth-provider/request_token
http://localhost:9090/oauth-provider/authorize
http://localhost:9090/oauth-provider/access_token
... or is that to come (as a separate oauth-provider web-app)?
So a read of the code (and watching what it does) suggests that the widget
executes the pasted sample JS. This makes a call to the core/io.makeRequest
method. Passing
AUTHENTICATED and sample
a proxy call is made to the proxy url on the server at:
proxy?url=http%3A%2F%2Flocalhost%3A9090%2Foauth-provider%2Fecho&output=js&auth=AUTHENTICATED&providerNick=sample
passing a X-Gadget-Security-Token header set to ? Appears to be undefined?
the proxyHandler extracts the url from the query string, and then the auth
param, and then the X-Gadget-Security-Token hdr.
Which throws the exception:
2008-02-08 00:36:09.680::WARN: /gadgets/proxy
java.lang.NullPointerException
at
org.apache.shindig.security.BlobCrypter.webSafeBase64Decode(BlobCrypter.java:92)
at org.apache.shindig.security.BlobCrypter.unwrap(BlobCrypter.java:144)
at
org.apache.shindig.security.BlobCrypter.unwrapProperties(BlobCrypter.java:217)
at
org.apache.shindig.gadgets.BasicGadgetToken.fromSerialForm(BasicGadgetToken.java:53)
at
org.apache.shindig.gadgets.BasicGadgetTokenSigner.createToken(BasicGadgetTokenSigner.java:55)
at
org.apache.shindig.gadgets.http.ProxyHandler.buildSigner(ProxyHandler.java:134)
at
org.apache.shindig.gadgets.http.ProxyHandler.fetchJson(ProxyHandler.java:70)
at
org.apache.shindig.gadgets.http.ProxyServlet.doGet(ProxyServlet.java:50)
<snip>
I think a null or an empty string is passed into
BasicGadgetTokenSigner.createToken() as the X-Gadget-Security-Token was
undefined?
> Create a demo of a server side container
> ----------------------------------------
>
> Key: SHINDIG-35
> URL: https://issues.apache.org/jira/browse/SHINDIG-35
> Project: Shindig
> Issue Type: New Feature
> Components: Gadgets Server - Java
> Reporter: Brian Eaton
> Assignee: John Hjelmstad
> Attachments: oauth.patch, sillyoauthgadget.js, testgadget.xml
>
>
> I'd like Shindig to have a sample implementation of a server-side container.
> I definitely don't want to build any type of robust or scalable user registry
> to go along with this work. I'd like to see scaffolding, not a lot of
> implementation.
> The ability to store user preferences on the server rather than the client
> would be a reasonable first milestone. A next milestone would be support for
> OAuth in gadgets.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.