S
S
stupin_a2019-05-16 12:26:56
API
stupin_a, 2019-05-16 12:26:56

Invalid_token error when making requests to Trello API, what did you miss?

I'm making a "Trello-Hub" project using the Trello API.
I use the ruby-trello, omniauth-trello and devise gems.
The ruby-trello gem " https://github.com/jeremytregunna/ruby-trello " is set up following the "Basic Authorization" example (found in the docs). I get all the data (from my dev account), I can create, delete, change - everything is ok here.
I implemented login and registration through Devise, as well as login through Trello account. Now my task is to make sure that requests go not to my dev account, but to the Trello user account (who entered the project through Trello). There is an instruction in the gem ( https://github.com/jeremytregunna/ruby-trello#mult...
I keep getting an invalid token error. Everything seems obvious)
Here is an example from the docs:

@client_bob = Trello::Client.new(
  :consumer_key => YOUR_CONSUMER_KEY,
  :consumer_secret => YOUR_CONSUMER_SECRET,
  :oauth_token => "Bob's access token",
  :oauth_token_secret => "Bob's access secret"
)

The steps are as follows:
1. Login to the project via Trello
2. Create a @client for the logged in user (code example above):
:oauth_token and :oauth_token_secret I take from the response from Trello when authorizing via Trello.
I take :consumer_key in the Trello dev account (key field), :consumer_secret also in the dev account (oauth-secret field). consumer_secret also tried to take from the token field in the dev account.
3. I make a request from the client (as indicated in the docs)
However, the error is always the same .. I tried a bunch of options for matching all available token, key and secret .. I'm doing something wrong.
Can anyone suggest? Hung on this for 6-7 hours. Made questions on stackoverflow and github. No replies :frowning:
My github issue with the workflow https://github.com/jeremytregunna/ruby-trello/issu...

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question