XeroAPI / xero-net-oauth2-sampletokenmigration

Sample app for migrating OAuth1.0a tokens to OAuth2.0 tokens.
1 stars 1 forks source link

Sample OAuth1.0a Token Migrator

This example elaborates on how to build a request for Xero's token migration endpoint, in order to swap an OAuth1.0a access token for a new set of OAuth2 access & refresh tokens.

It's a .Net Core 3.0 application, but the flow should be clear enough that it can be applied to your language/framework of choice. Note the code has been optimised for clear understanding of the flow, and is not intended to be used as-is in a production environment.

It assumes you've already created OAuth2 credentials for your app at https://developer.xero.com/myapps

Instructions

You should see the OAuth2 access & refresh tokens, and the organisations for which the tokens apply, listed in the terminal window.