Skip to content

Instantly share code, notes, and snippets.

@jeromyevans
Created June 10, 2015 06:11
Show Gist options
  • Save jeromyevans/1d2b7e390a699b26da2d to your computer and use it in GitHub Desktop.
Save jeromyevans/1d2b7e390a699b26da2d to your computer and use it in GitHub Desktop.
Configure the endpoints for three-legged oauth with Xero
// 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 is the xero-accessed resource that provides details of the request token
// this route is specified by the oauth_callback_url
server.route({
method: 'GET',
path: '/callback',
handler: function(request, reply) {
XeroClient.requestXeroAccessToken(request, reply);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment