Xero - beautiful accounting software

Xero Developer Help Center

Xero Developer Community

Community > API Authentication >

API authentication error

Started by Shaun Azam -   in API Authentication

I am developing an application for the Xero API using the Node SDK. I have recently started having a problem where one of the accounts I am trying to use to log in is generating 401 Unauthorized errors in my callback handler. This account has been working previously with the same code and another account I am using is still working.
In the error response from the API it mentions ‘insufficient_scope’. This seems strange since the same scope works for a different account and has worked for this account before. The scope I am requesting is 'openid profile email accounting.contacts offline_access'.
My callback handler is very simple and almost identical to the sample application so I can’t quite see what is going wrong. (https://gist.github.com/robert-nash/b499cc66a8b7370c7ba098556c60045c)
This code is provided by the developer community - Xero does not warrant it in any way