Skip to content

Instantly share code, notes, and snippets.

@jeromyevans
Created June 10, 2015 06:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeromyevans/a5fdcf6849ead322aeee to your computer and use it in GitHub Desktop.
Save jeromyevans/a5fdcf6849ead322aeee to your computer and use it in GitHub Desktop.
Configure oauth package to work with Xero API
// Xero API defaults to application/xml content-type
var customHeaders = {
"Accept" : "application/json",
"Connection": "close"
};
var oauth = new OAuth.OAuth(
REQUEST_URL,
ACCESS_URL,
CONSUMER_KEY,
CONSUMER_SECRET,
'1.0A',
null,
'HMAC-SHA1',
null,
customHeaders
);
// This is important - Xero will redirect to this URL after successful authentication
// and provide the request token as query parameters
oauth._authorize_callback=CALLBACK_URL;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment