Closed SirVer closed 3 years ago
Currently the oauth2 helper code only implements support for the "implicit grant flow" and the older long-lived tokens (it predates our using short-lived tokens), so it won't be super helpful since it doesn't give access to the refresh token you need, unfortunately.
However, you can call the OAuth2 endpoints yourself pretty easily, and all you need to create your HTTP client is the resulting access token:
let client = dropbox_sdk::default_client::UserAuthDefaultClient::new(token);
This section of the documentation page goes into greater detail about the specific endpoints used for all three flows. The OAuth2 helper code in this crate implements one of these.
When I get some spare time, I'll look into updating the helper code for the newer short-lived tokens and maybe also the PKCE flow as well.
@wfraser I would be extremely grateful if you could augment the helper code with short lived and PKCE. I have read through the documentations and the code you linked and I still feel a bit like a fish out of water, not feeling very confident in being able to contribute helper code myself.
Otoh, I am relying on rust dropbox sync code in my toy iOS App that I use everyday and cannot imagine doing without now. It will stop working in ~80 days when dropbox pulls the plug on long lived tokens. Halp!
@SirVer I've put out a PR with several changes, including support for refresh tokens and PKCE. The examples have also been updated to use PKCE. If you get a chance, please take a look and see if this covers what you were looking for. You won't need to deal with updating the tokens yourself (the HTTP client will take care of that) but the way the client is constructed is slightly different now.
implemented in #63 and will go out in next version v0.13.0
I've did not yet get around to testing this, but will definitely do soon and get back to you! Really grateful for the work you put into this. Thanks Bill!
I have read through the example and how it is getting its OAuth token. However I recently read through https://developers.dropbox.com/oauth-guide and also learned that Dropbox will disable support for permanent access tokens in the future.
Reading through the page, my application best fits:
Hence, I should use:
I wondered if this is possible with v0.11.3 of this client library? If so, how?