Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
Hello,
I'm currently migrating one of my iOS app to the V2 of the API.
When a user authorize my app to use its Dropbox account I want to retrieve the OAuth2 token to share it with my server to allow long running backgroud processes.
This worked fine with the V1 of the API and still works fine in V2 when the authorization is made from a browser or a web view as the token is in the url returned by the SDK.
However, when the auth is done by the Dropbox iOS app, the url returned in to the
-application: openURL: options:
method is different and provides an oauth_token_secret parameter but no access_token.
How can I get the oauth2 token from the SDK knowing that the DBOAuthResult returns the same oauth_token_secret for its accessToken property in this case ? and not a valid oauth2 token.
Alternatively, is it possible to forbid the auth flow to use the installed Dropbox iOS app ?
Thanks !
Hi, it sounds like you're using the official API v2 Objective-C SDK. Is that correct? If so, the SDK handles the access token retrieval and storage for you, regardless of which flow exactly was used (e.g., via app or web). If you're using that SDK, you should just implement the authorization flow as documented here.
That will automatically store the token, and you can then retrieve the client via DBClientsManager authorizedClient. That is, you don't need to check the URL parameters yourself.
If you then do want to retrieve the access token(s) themselves, you can use DBOAuthManager.getAccessToken or DBOAuthManager.getAllAccessTokens.
Hi, it sounds like you're using the official API v2 Objective-C SDK. Is that correct? If so, the SDK handles the access token retrieval and storage for you, regardless of which flow exactly was used (e.g., via app or web). If you're using that SDK, you should just implement the authorization flow as documented here.
That will automatically store the token, and you can then retrieve the client via DBClientsManager authorizedClient. That is, you don't need to check the URL parameters yourself.
If you then do want to retrieve the access token(s) themselves, you can use DBOAuthManager.getAccessToken or DBOAuthManager.getAllAccessTokens.
Thanks, that works perfectly!
Hi there!
If you need more help you can view your support options (expected response time for a ticket is 24 hours), or contact us on X or Facebook.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!