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
// this is the user-accessed resource that initiates the authentication with xero. | |
// the user will eventually be redirected to Xero's authorize page | |
server.route({ | |
method: 'GET', | |
path: '/authenticate', | |
handler: function(request, reply) { | |
XeroClient.requestXeroRequestToken(request, reply); | |
} | |
}); |
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, |
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
// Perform the callback leg of the three-legged oAuth. | |
// Given the auth_token and auth_verifier from xero, request the AccessToken | |
exports.requestXeroAccessToken = function(request, reply) { | |
var oAuthToken = request.query["oauth_token"]; | |
var oAuthVerifier = request.query["oauth_verifier"]; | |
var org = request.query["org"]; | |
var oAuthData = request.session.get('oauth'); |
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
oauth.get('https://api.xero.com/api.xro/2.0/Organisation', | |
oauth_access_token, | |
oauth_access_token_secret, | |
function (e, data, res) { | |
if (e) { | |
console.error(e); | |
return; | |
} | |
var oResponse = JSON.parse(data); |
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
// Initiate the request to Xero to get an oAuth Request Token. | |
// With the token, we can send the user to Xero's authorize page | |
exports.requestXeroRequestToken = function(request, reply) { | |
oauth.getOAuthRequestToken(function(error, oauth_token, oauth_token_secret, results) { | |
if (error) { | |
console.log(error); | |
return reply.view('failed'); |
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
Built on Feb 29 2016 15:11:54 | |
Config lost - RTC invalid - external reset/power failure | |
04003660: 20 f8 5e a | |
b 21 55 ff ff 39 35 30 45 | |
04003680: 45 41 41 44 37 32 42 30 36 35 46 36 43 39 34 36 36 43 37 30 43 44 41 3 | |
9 42 39 37 41 93 2c 80 00 | |
040036a0: 01 02 ff ff | |
Flojo App version 39, WFW version 2c0200 | |
Boot time 0 |
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
Built on Feb 29 2016 15:11:54 | |
04003660: 20 f8 5e a | |
b 21 55 ff ff 39 35 30 45 | |
04003680: 45 41 41 44 37 32 42 30 36 35 46 36 43 39 34 36 36 43 37 30 43 44 41 3 | |
9 42 39 37 41 93 2c 80 00 | |
040036a0: 01 02 ff ff | |
Flojo App version 39, WFW version 2c0200 | |
Boot time 1456758918 | |
Time now 1456758918 |
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
Built on Feb 29 2016 15:11:54 | |
04003660: 20 f8 5e a | |
b 21 55 ff ff 39 35 30 45 | |
04003680: 45 41 41 44 37 32 42 30 36 35 46 36 43 39 34 36 36 43 37 30 43 44 41 3 | |
9 42 39 37 41 93 2c 80 00 | |
040036a0: 01 02 ff ff | |
Flojo App version 39, WFW version 2c0200 | |
Boot time 1456759024 | |
Time now 1456759024 |
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
Built on Feb 29 2016 15:11:54 | |
04003660: 20 f8 5e a | |
b 21 55 ff ff 39 35 30 45 | |
04003680: 45 41 41 44 37 32 42 30 36 35 46 36 43 39 34 36 36 43 37 30 43 44 41 3 | |
9 42 39 37 41 93 2c 80 00 | |
040036a0: 01 02 ff ff | |
Flojo App version 39, WFW version 2c0200 | |
Boot time 1456760456 | |
Time now 1456760456 |
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
Built on Feb 29 2016 15:11:54 | |
Config lost - RTC invalid - external reset/power failure | |
04003660: 20 f8 5e a | |
b 21 55 ff ff 39 35 30 45 | |
04003680: 45 41 41 44 37 32 42 30 36 35 46 36 43 39 34 36 36 43 37 30 43 44 41 3 | |
9 42 39 37 41 93 2c 80 00 | |
040036a0: 01 02 ff ff | |
Flojo App version 39, WFW version 2c0200 | |
Boot time 0 |