waynerobinson / xeroizer

Xero accounting system API library.
http://waynerobinson.github.com/xeroizer
Other
238 stars 311 forks source link

Not recognizing my tokens #481

Closed mikeheft closed 3 years ago

mikeheft commented 5 years ago

I'm not sure if this is an issue with how I'm authorizing my users or not. But hopefully you're able to offer some insight. I am using the omniauth-xero gem to authorize my clients. I'm storing the token, secret token, and oauth_verifier in a model associated with the user. As it stands now, I am using a public application(will probably upgrade to a partner after development is finished or closer to being finished with my app). I am using the method client.authorize_from_request(credential.token, credential.secret, oauth_verifier: credential.oauth_verifier) but am getting 401s. I'm able to create the base instance of the client no problem, but looking at the docs here it seems I still need this step in order to be able to get an access token to call the #authorize_from_access method

Update: I think I see what's going on now. The omniauth gem is going the exchange for the access tokens. When I access the xeroizer client in the terminal, I can do client.access_token and see the token/secret there and they match what I'm storing in the database. So now I just try a basic call to client.Account.all and I get a 401 error, saying the signature is invalid. I see on here that it happens quite a bit and that it's most likely a xero api issue. Any advice?

rjaus commented 3 years ago

Relates to OAuth1, irrelevant now that OAuth 2 has been released.