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

DropboxTeam.as_user throws BadInputException app_key is required to refresh tokens #213

Closed
dyronald opened this issue Aug 21, 2020 · 2 comments · Fixed by #218
Closed

DropboxTeam.as_user throws BadInputException app_key is required to refresh tokens #213

dyronald opened this issue Aug 21, 2020 · 2 comments · Fixed by #218

Comments

@dyronald
Copy link

dbx_t = dropbox.DropboxTeam(
    oauth2_refresh_token=refresh_token, 
    app_key=app_key, 
    app_secret=app_secret 
) 
admin = dbx_t.team_token_get_authenticated_admin()
dbx_t.as_user(admin.admin_profile.team_member_id)

This raises

File "venv/lib/python3.6/site-packages/dropbox/dropbox.py", line 715, in as_user
    team_member_id)
File "venv/lib/python3.6/site-packages/dropbox/dropbox.py", line 739, in _get_dropbox_client_with_select_header
    headers=new_headers,
File "venv/lib/python3.6/site-packages/dropbox/dropbox.py", line 185, in __init__
    raise BadInputException("app_key is required to refresh tokens")
dropbox.dropbox.BadInputException: app_key is required to refresh tokens

I looked into the code at dropbox/dropbox.py line 739. It seems like the app_key and app_secret arguments are not passed to the new Dropbox instance.

@greg-db
Copy link
Contributor

greg-db commented Aug 21, 2020

[Cross-linking for reference: https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Python-SDK-DropboxTeam-as-user-throws-BadInputException-app-key/m-p/447037#M23296 ]

Thanks. This looks like a bug in the SDK itself. We'll look into it. I'll follow up here once I have an update for you.

@rogebrd rogebrd linked a pull request Aug 28, 2020 that will close this issue
@greg-db
Copy link
Contributor

greg-db commented Aug 31, 2020

This should be fixed as of v10.4.1. Please give it a try and let us know if you run in to any issues. Thanks!

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 a pull request may close this issue.

2 participants