Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix authentication problems when downloading card attachments #35

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jpcercal
Copy link

@jpcercal jpcercal commented Dec 18, 2021

I was facing the problem below when downloading the card attachments using the trello-full-backup python script provided by this repo:

unauthorized permission requested

After debugging the application a little bit and reading the documentation of Trello REST API I found a solution, you will find more details about it here:

Authorization header

The Trello API will also accept authorization via an Authorization header with the format: OAuth oauth_consumer_key="{{apiKey}}", oauth_token="{{apiToken}}".

For instance, here is the same request as above, but using an Authorization header:

curl -H "Authorization: OAuth oauth_consumer_key=\"{{apiKey}}\", oauth_token=\"{{apiToken}}\"" https://api.trello.com/1/members/me

https://developer.atlassian.com/cloud/trello/guides/rest-api/authorization/#authorization-header

When the attachment URL is under the trello endpoint it requires the caller to be authenticated in order to process the request and so download the file.

Note that, this process is probably not needed when the attachment URL points out to an S3 bucket or some other storage layer, it seems to be randomly assigned or maybe the Trello service now acts as a proxy in front of all requests to improve a little bit the security as before those files were all acessible publicly by default? I don't know, but with this change we get card attachments being downloaded successfully again. =)

@Yerough
Copy link

Yerough commented Jan 3, 2022

Thanks a lot! Works perfectly!

@cdown
Copy link

cdown commented Apr 14, 2022

Thanks! There is definitely a problem here, but this doesn't seem to solve it for me, the files are still unauthorised:

tfb-out % sed '' -- **/*.pdf | sort | uniq -c 
     87 unauthorized permission requested

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants