Try gadget in the attachment (takes contacts from your gmail account)
Add the lines below to your oauth.json.
"http://path_to_your_gadget/oauth_example.xml" : {
"google" : {
"consumer_secret" : "you_will_get_it_from_google",
"consumer_key" : "your_consumer_key_from_google",
"key_type" : "HMAC_SHA1"
}
},
You can get the keys for google here:
https://www.google.com/accounts/ManageDomains
This worked perfectly for me a week or two ago
On 01.06.10 21:26, Normandes Jr wrote:
So, where should I start take a look to be able solve this issue? How could I know if the gadget spec is OK? On Tue, Jun 1, 2010 at 4:21 PM, Cesar William<[email protected]> wrote:---------- Forwarded message ---------- From: Paul Lindner<[email protected]> Date: Tue, Jun 1, 2010 at 4:17 PM Subject: Re: Error at shindig with OAuth To: [email protected] Shindig fetches the gadget spec to pull in the<Oauth...> stanza, if your gadget spec cannot be loaded it will give that error message. Now why that's happening is another question. It could be that your gadget spec is not getting served up, or it could be a configuration issue with the shindig server you have set up (behind a proxy, dns, etc.) On Tue, Jun 1, 2010 at 12:05 PM, Normandes Jr<[email protected]> wrote:Hi, Any gadget that I try to use OAuth, I get this error: WARNING: OAuth fetch fatal error OAuth error [UNKNOWN_PROBLEM, Could not fetch gadget spec] forapplication. Request trace: ==== Original request: GET /m8/feeds/contacts/default/base?alt=json Host: www.google.com X-Shindig-AuthType: oauth X-Forwarded-For: 127.0.0.1 X-shindig-dos: on ==== [UNKNOWN_PROBLEM,Could not fetch gadget spec] atorg.apache.shindig.gadgets.oauth.GadgetOAuthTokenStore.findSpec(GadgetOAuthTokenStore.java:286)atorg.apache.shindig.gadgets.oauth.GadgetOAuthTokenStore.lookupSpecInfo(GadgetOAuthTokenStore.java:129)atorg.apache.shindig.gadgets.oauth.GadgetOAuthTokenStore.getOAuthAccessor(GadgetOAuthTokenStore.java:94)atorg.apache.shindig.gadgets.oauth.OAuthRequest.fetchNoThrow(OAuthRequest.java:192)atorg.apache.shindig.gadgets.oauth.OAuthRequest.fetch(OAuthRequest.java:176)atorg.apache.shindig.gadgets.http.DefaultRequestPipeline.execute(DefaultRequestPipeline.java:92)atorg.apache.shindig.gadgets.servlet.MakeRequestHandler.doFetch(MakeRequestHandler.java:91)at org.apache.shindig.gadgets.servlet.ProxyBase.fetch(ProxyBase.java:169) atorg.apache.shindig.gadgets.servlet.MakeRequestServlet.doGet(MakeRequestServlet.java:49)atorg.apache.shindig.gadgets.servlet.MakeRequestServlet.doPost(MakeRequestServlet.java:55)at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511) atorg.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)atorg.apache.shindig.auth.AuthenticationServletFilter.callChain(AuthenticationServletFilter.java:123)atorg.apache.shindig.auth.AuthenticationServletFilter.doFilter(AuthenticationServletFilter.java:86)atorg.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388) atorg.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765) atorg.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)atorg.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)atorg.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at org.mortbay.jetty.Server.handle(Server.java:326) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542) atorg.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:938)at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:755) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) atorg.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)atorg.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)Caused by: org.apache.shindig.gadgets.GadgetException: Url does not include scheme atorg.apache.shindig.gadgets.http.DefaultRequestPipeline.normalizeProtocol(DefaultRequestPipeline.java:133)atorg.apache.shindig.gadgets.http.DefaultRequestPipeline.execute(DefaultRequestPipeline.java:61)atorg.apache.shindig.gadgets.AbstractSpecFactory.fetchFromNetwork(AbstractSpecFactory.java:130)atorg.apache.shindig.gadgets.AbstractSpecFactory.getSpec(AbstractSpecFactory.java:90)atorg.apache.shindig.gadgets.DefaultGadgetSpecFactory.getGadgetSpec(DefaultGadgetSpecFactory.java:86)atorg.apache.shindig.gadgets.oauth.GadgetOAuthTokenStore.findSpec(GadgetOAuthTokenStore.java:281)... 32 more Cold you help me? Thanks, Normandes Junior Brazil.
<?xml version="1.0" encoding="UTF-8"?>
<Module>
<ModulePrefs title="OAuth Contacts" scrolling="true">
<Require feature="opensocial-0.8"/>
<Require feature="locked-domain"/>
<OAuth>
<Service name="google">
<Access url="https://www.google.com/accounts/OAuthGetAccessToken" method="GET"/>
<Request url="https://www.google.com/accounts/OAuthGetRequestToken?scope=http://www.google.com/m8/feeds/" method="GET"/>
<Authorization url="https://www.google.com/accounts/OAuthAuthorizeToken?oauth_callback=http://oauth.gmodules.com/gadgets/oauthcallback"/>
</Service>
</OAuth>
</ModulePrefs>
<Content type="html">
<![CDATA[
<!-- ALm6fM1czDO2PY//eXvftYGTOvJoD6HOQc8SJwhWai+aZi8T6T1FJMXnEDGY3bMjgd3vH+kYWnjgx52BcHxqS2vj/p/MdmowNBnMwK6QrUO7HuVHkTUJ/I1gbKAfsIt7jwQc2Fi5UKHV --> <!-- shindig oauth popup handling code -->
<script src="http://gadget-doc-examples.googlecode.com/svn/trunk/opensocial-gadgets/popup.js"></script>
<style>
#main {
margin: 0px;
padding: 0px;
font-size: small;
}
</style>
<div id="main" style="display: none">
</div>
<div id="approval" style="display: none">
<img src="http://gadget-doc-examples.googlecode.com/svn/trunk/images/new.gif">
<a href="#" id="personalize">Personalize this gadget</a>
</div>
<div id="waiting" style="display: none">
Please click
<a href="#" id="approvaldone">I've approved access</a>
once you've approved access to your data.
</div>
<script type="text/javascript">
// Display UI depending on OAuth access state of the gadget (see <divs> above).
// If user hasn't approved access to data, provide a "Personalize this gadget" link
// that contains the oauthApprovalUrl returned from makeRequest.
//
// If the user has opened the popup window but hasn't yet approved access, display
// text prompting the user to confirm that s/he approved access to data. The user
// may not ever need to click this link, if the gadget is able to automatically
// detect when the user has approved access, but showing the link gives users
// an option to fetch their data even if the automatic detection fails.
//
// When the user confirms access, the fetchData() function is invoked again to
// obtain and display the user's data.
function showOneSection(toshow) {
var sections = [ 'main', 'approval', 'waiting' ];
for (var i=0; i < sections.length; ++i) {
var s = sections[i];
var el = document.getElementById(s);
if (s === toshow) {
el.style.display = "block";
} else {
el.style.display = "none";
}
}
}
// Process returned JSON feed to display data.
function showResults(result) {
showOneSection('main');
var titleElement = document.createElement('div');
var nameNode = document.createTextNode(result.feed.title.$t);
titleElement.appendChild(nameNode);
document.getElementById("main").appendChild(titleElement);
document.getElementById("main").appendChild(document.createElement("br"));
list = result.feed.entry;
for(var i = 0; i < list.length; i++) {
entry = list[i];
var divElement = document.createElement('div');
divElement.setAttribute('class', 'name');
var valueNode = document.createTextNode(entry.gd$email[0].address);
divElement.appendChild(nameNode);
divElement.appendChild(valueNode);
document.getElementById("main").appendChild(divElement);
}
}
// Invoke makeRequest() to fetch data from the service provider endpoint.
// Depending on the results of makeRequest, decide which version of the UI
// to ask showOneSection() to display. If user has approved access to his
// or her data, display data.
// If the user hasn't approved access yet, response.oauthApprovalUrl contains a
// URL that includes a Google-supplied request token. This is presented in the
// gadget as a link that the user clicks to begin the approval process.
function fetchData() {
var params = {};
url = "http://www.google.com/m8/feeds/contacts/default/base?alt=json";
params[gadgets.io.RequestParameters.CONTENT_TYPE] = gadgets.io.ContentType.JSON;
params[gadgets.io.RequestParameters.AUTHORIZATION] = gadgets.io.AuthorizationType.OAUTH;
params[gadgets.io.RequestParameters.OAUTH_SERVICE_NAME] = "google";
params[gadgets.io.RequestParameters.METHOD] = gadgets.io.MethodType.GET;
gadgets.io.makeRequest(url, function (response) {
if (response.oauthApprovalUrl) {
// Create the popup handler. The onOpen function is called when the user
// opens the popup window. The onClose function is called when the popup
// window is closed.
var popup = shindig.oauth.popup({
destination: response.oauthApprovalUrl,
windowOptions: null,
onOpen: function() { showOneSection('waiting'); },
onClose: function() { fetchData(); }
});
// Use the popup handler to attach onclick handlers to UI elements. The
// createOpenerOnClick() function returns an onclick handler to open the
// popup window. The createApprovedOnClick function returns an onclick
// handler that will close the popup window and attempt to fetch the user's
// data again.
var personalize = document.getElementById('personalize');
personalize.onclick = popup.createOpenerOnClick();
var approvaldone = document.getElementById('approvaldone');
approvaldone.onclick = popup.createApprovedOnClick();
showOneSection('approval');
} else if (response.data) {
showOneSection('main');
showResults(response.data);
} else {
// The response.oauthError and response.oauthErrorText values may help debug
// problems with your gadget.
var main = document.getElementById('main');
var err = document.createTextNode('OAuth error: ' +
response.oauthError + ': ' + response.oauthErrorText);
main.appendChild(err);
showOneSection('main');
}
}, params);
}
// Call fetchData() when gadget loads.
gadgets.util.registerOnLoadHandler(fetchData);
</script>
]]>
</Content>
</Module>
