Skip to content

Instantly share code, notes, and snippets.

@chentepixtol
Created February 1, 2013 20:15
Show Gist options
  • Select an option

  • Save chentepixtol/4693809 to your computer and use it in GitHub Desktop.

Select an option

Save chentepixtol/4693809 to your computer and use it in GitHub Desktop.
OAuth javascript
// configurar provider
jso_configure({
"facebook": {
client_id: "454779664560438",
redirect_uri: "http://localhost:9300/#facebook/",
authorization: "https://www.facebook.com/dialog/oauth",
presenttoken: "qs"
}
});
// asegurar token
jso_ensureTokens({
"facebook": ["read_stream"],
});
// petición
$.oajax({
url: "https://graph.facebook.com/me/home",
jso_provider: "facebook",
jso_scopes: ["read_stream"],
jso_allowia: true,
dataType: 'json',
success: function(data) {
console.log("Response (facebook):");
console.log(data);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment