Comments (11)
@MJMortimer Do you mean this type of 401?
%{message: %{"oauth_problem" => "token_rejected",
"oauth_problem_advice" => "Token XXX does not match an expected ACCESS token"},
status_code: 401}
Is there any workaround? The SDK seems to work fine for my test Xero account but not for the real one :( It works fine with https://www.npmjs.com/package/xero Can you point me to where I might need to make a fix?
from elixero.
No, the 401 error that this produces are "Failed to validate signature" errors. Reason being, the SDK signs it one way but the API signs it differently and so the signatures don't match
from elixero.
Hmm any idea why I might be getting that error with one xero account but not another (bearing in mind it works fine with a Node SDK so is not an issue with the credentials)? Can I ask why you wrote your own oauth module rather than using one of the oauth modules from mix? Is it worth trying that?
from elixero.
What type of application have you created?
If it's a public app you'll need to make sure you are going through the oauth flow each time the token expires after 30 minutes and for each organisation you connect to.
The oauth 1.0 implementation used in the Xero API is a little bit custom and so I wasn't sure if any other oauth modules would work correctly. If you'd like to look into switching it out for another module from mix I'll be happy to look through any changes.
from elixero.
It's a private app.
Hmm ok I might try using another module. I noticed the node implementation used an off the shelf oauth module which gives me hope.
from elixero.
Have you created a private app for each organisation?
from elixero.
Yeah it works for one organisation but not the other.
from elixero.
Weird.
Have you tried recreating the failing private app or generating new keys for the failing private app?
Also, I'm sure you've checked this but, have you definitely provided the consumer key and secret in the correct properties in the config (they haven't been mixed up or a character missing off the end etc)
from elixero.
Yeah I have. Will try again just in case.
from elixero.
Also if you've created different signing keys for each you should make sure you're using the correct one
from elixero.
For some reason running mix deps.compile
fixed this issue. Don't understand why 🤷♂️
Thanks for your help!
from elixero.
Related Issues (12)
- Improve readme
- Include other APIs
- Usage instructions HOT 4
- Pass in Xero configuration when creating the Client struct
- Support if-modified-since when filtering
- Support for OAuth 2.0 (client credentials grant) HOT 1
- Implement Attachments
- Multiple Where Clause HOT 1
- Overpayments/Prepayments allocation resource incorrectneeds /allocations
- Upload file with different name
- Failed to validate signature when absolute callback url is used. HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from elixero.