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

add query_authorize_extra optional parameter to drop_auth in order to… #203

Closed
wants to merge 1 commit into from
Closed

add query_authorize_extra optional parameter to drop_auth in order to… #203

wants to merge 1 commit into from

Conversation

jcarbaut
Copy link

Add query_authorize_extra optional parameter to drop_auth in order to allow passing token_access_type = 'offline') to httr::oauth2.0_token

Fixes #201

Dropbox changed their API to only allow short lived tokens by default, which is not usable from a server app (shiny for instance).
Instead, one must generate a refresh_token, and httr already has everything to work with a token generated this way. For the Dropbox API, this means passing an extra argument in the URL: token_access_type = "offline".

This can be done with the query_authorize_extra argument of httr::oauth2.0_token, as explained here. This requires httr 1.4.0.

Then, to generate a token: token <- drop_auth(query_authorize_extra = list(token_access_type = "offline")
And to refresh: token$refresh().

An interesting addition would be to have rdrop2 manage the token refreshing when needed. It might already be done in httr2, but this would probably require further developments. This commit only addresses the creation of a token that includes both an access token (short lived) and a refresh token (long lived).

… allow passing token_access_type = 'offline') to httr::oauth2.0_token
This pull request was closed.
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.

drop_auth() generating short lived tokens
1 participant