You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.

Forum Discussion

Mark R.5's avatar
Mark R.5
Helpful | Level 5
4 years ago

Migrating to refresh token on Android - Sample not working

Hi. I am in the process of migrating from long lived tokens, to refresh tokens for offline access. I haven't made any changes in the App Console yet, I'm just trying to get a proof of concept, by linking using scoped PKCE offline access. 

 

I noticed the Android samples had been updated for PKCE and offline access (this is the default behaviour in the sample). So I updated the sample to add my App Key to the manifest and the strings.xml as instructed. However the linking process is failing both when using the Dropbox app and Chrome. This is on Android 10, but same observed on Android 7. I have added the URL that was generated for the browser access below, and screenshots of the errors received. Note that the Dropbox app error was received after pressing 'Allow' (obviously I did have an internet connection at the time), the website came up with the 400 error before showing anything:

 

 

 

 

 

https://www.dropbox.com/1/connect
    ?locale=en_GB
    &k={APP_KEY_WAS_ENTERED_CORRECTLY}
    &n=0
    &api=1
    &state=oauth2code%3AAOnfqepB6EDsFiSePtv7F_KdlLNfuj-9d5OHrc4oWPw%3AS256%3Aoffline%3Aaccount_info.read+files.content.write
    &extra_query_params=code_challenge%3DAOnfqepB6EDsFiSePtv7F_KdlLNfuj-9d5OHrc4oWPw%26code_challenge_method%3DS256%26token_access_type%3Doffline%26response_type%3Dcode%26scope%3Daccount_info.read+files.content.write
 

 

 

 

 

 

  • Are you using an app key for an app that hasn't been migrated to scopes yet? This can occur if so. (Apologies for the unhelpful error messages!) In order to set scopes during the app authorization flow like this, you'll need to use an app key for an app that is set to use scopes.

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Staff rankDropbox Staff

    Are you using an app key for an app that hasn't been migrated to scopes yet? This can occur if so. (Apologies for the unhelpful error messages!) In order to set scopes during the app authorization flow like this, you'll need to use an app key for an app that is set to use scopes.

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

5,910 PostsLatest Activity: 3 days ago
333 Following

If you need more help you can view your support options (expected response time for an email or 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!