sarumont / py-trello

Python API wrapper around Trello's API
BSD 3-Clause "New" or "Revised" License
945 stars 330 forks source link

Difficult to authenticate - any tips? #305

Closed mbbroberg closed 4 years ago

mbbroberg commented 4 years ago

Hey all, thanks for writing this helpful module.

I was wondering if others have a more efficient way of retrieving the token and token secret when writing projects that use py-trello. My current instructions are somewhere between a spy novel and a scene from Momento. Here it is:

The right solution to authenticating

  1. Go to https://trello.com/app-key/
  2. Your API key is at the top
  3. Your API secret is at the bottom (ignore the fact it's under the OAUTH section. That's misleading when it comes to usage)
  4. Clone this repo https://github.com/sarumont/py-trello
  5. Install the requirements: I use virtualenv so:
    1. cd py-trello
    2. virtualenv venv
    3. source venv/bin/activate
    4. pip install -r requirements.txt
  6. Run the helper utility to get your token and token secret:

You now have all the pieces to authenticate using the trello.TrelloClient() function.

Question

Is there a better way?

Thanks!

mbbroberg commented 4 years ago

Hey @sarumont, nudging this your way in case you have any tips. I'd love to write up or PR changes to make it easier. Thanks 👋

sarumont commented 4 years ago

@mbbroberg That sounds about right, given the API at the time I originally wrote this. It may be possible to use an OAuth token against the Trello API now (one would think...). In this case, a PR would be welcome to use that rather than the OAuth secrets.

This would be a more modern approach to API authentication, however I have not personally been using py-trello or Trello's API at all recently.

mbbroberg commented 4 years ago

Thanks @sarumont. If I find a smarter way I'll PR It.