Search code examples
c#oauth-2.0xero-apipkce

Is there a way to signin Xero api using oauth2 in c# desktop application?


There are several .Net sample codes that using oauth2 to signin Xero, but all of them is working with browser (most of the sample code for C# is for ASP.NET MVC).

I am going to develop a desktop application using Xero Api but Xero official tutorial said that mobile or desktop application should use PKCE flow instead of using ClientID/Secret scheme.

And in this PKCE flow, user should interact with browser to get Authorization code.

I want to know if there is any way to signin without user interaction.


Solution

  • Xero api signin was just migrated to use OAuth2.0 and it should interact with browser at least once. Once you get refresh_token using offline_access scope, you will use this token to get access token. Unfortunately they don't support custom url scheme. Hope this will be helpful for you.