Xero - beautiful accounting software

Xero Developer Help Center

Xero Developer Community

Community > API Authentication >

OAuth2.0 via CLI not connecting via xoauth

Started by Emmanuel Bourmault -   in API Authentication

I'm trying to update to OAuth2.0 from OAuth1.0, but my integration is mainly automatic via the server which is on Ubuntu, so I read a bit around and there is xoauth that should be doing that https://github.com/XeroAPI/xoauth.
However, xoauth seems to require opening the browser, for some unknown reasons, which just can't work in a remote environment obviously!
I get the issue:
error creating client: failed to unlock correct collection '/org/freedesktop/secrets/aliases/default'

And I'm not the only one getting that issue, it has been reported multiple times. And instead of fixing this issue, you just deprecate the use of the perfectly working OAuth1.0 and just put us in a difficult position as we have to rewrite all the logic because of your bug.
Could you please enable us to create OAuth1.0 apps until you get this fixed?
Hi Emmanuel,

The development is being completed for the OAuth2.0 equivalent of the Private app infrastructure (aka client_credentials grant). This will initially be available in US, UK, NZ, and in other regions soon after.

https://developer.xero.com/announcements/custom-integrations-are-coming/

I made a video about developers in your situation and how to set up a M2M script using oauth2 and a browser based initial auth.

https://www.youtube.com/watch?v=Zcf_64yreVI

Once you have the token set from manual user auth, you can plug that back into your existing logic. However you will need to code the ability for the script to refresh the token prior to each use.
 

Christopher Knight (Xero Staff)