Created
June 10, 2015 06:13
-
-
Save jeromyevans/a5fdcf6849ead322aeee to your computer and use it in GitHub Desktop.
Configure oauth package to work with Xero API
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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