Skip to content

Instantly share code, notes, and snippets.

View gautamk's full-sized avatar

Gautam gautamk

  • Block | Meta | Appdynamics | Cisco | Amazon | University of Washington
  • Seattle
View GitHub Profile
//http://blog.kevburnsjr.com/javascript-asynchronous-rsa-key-generation
//http://kjur.github.io/jsrsasign/api/symbols/RSAKey.html
function xeroTest() {
var oauth_nonce = createGuid();
var oauth_timestamp = (new Date().valueOf()/1000).toFixed(0);
var signatureBase = "GET" + "&"
+ encodeURIComponent("https://api.xero.com/api.xro/2.0/Organisation") + "&"
+ encodeURIComponent("oauth_consumer_key=" + UserProperties.getProperty("consumerKey") + "&oauth_nonce="+oauth_nonce+"&oauth_signature_method=RSA-SHA1&oauth_timestamp="+oauth_timestamp+"&oauth_token=" + UserProperties.getProperty("consumerKey") + "&oauth_version=1.0");