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

chelizi's avatar
chelizi
Helpful | Level 5
4 years ago

moblie app using /oauth2/authorize interface redirect_uri problem

     We plan to use the HTTP interface instead of the Android SDK when connecting to the dropbox. There is a problem in using the redirect_uri parameter in /oauth2/authorize.

     After the authentication is complete, we intend to redirect the app to continue subsequent operations. Now we can't go back to our app. After the authentication is complete, it is in the system browser. How can I redirect to the app?

     Currently, I have not found an example of returning to the app after authentication. In the guide document ”The redirect_uri is optional with the code flow - if unspecified, the authorization code is displayed on dropbox.com for the user to copy and paste to your app.
     This extra step is less convenient for end users, but appropriate for apps that cannot support a redirect.“

How do we skip this step, or how do we configure in the app to support redirect?

  • Yes, you can use the redirect_uri option for this. The redirect URI you supply doesn't actually need to be an HTML web page. You should use the PKCE option, and use a redirect URI that goes directly to your app, e.g., by using a custom URL scheme that you register for your app.

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

    To redirect back to your app after the user authorizes the app, you should use the 'redirect_uri' parameter on /oauth2/authorize that you mentioned. I recommend referring to the /oauth2/authorize documentation and OAuth Guide for more information. 

     

    Can you elaborate on what you mean when you say "There is a problem in using the redirect_uri parameter in /oauth2/authorize"? What do you have so far, and what isn't working exactly?

    • chelizi's avatar
      chelizi
      Helpful | Level 5

      We access /oauth2/authorize in the app. The system browser is displayed. After the authorization is successful, we needs to redirect to the HTML page written by the us and then start the app on the page. shows the process is app --> system browser --> HTML page --> app. In this scenario, the app is running in the background. Is there any way to return the app after the authorization is successful ?  The entire process is as follows: app --> System browser authorization --> After the authorization is successful, back to app . Omit the HTML developed by us start the app page.  Greg-DB   Thanks

       

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

        Yes, you can use the redirect_uri option for this. The redirect URI you supply doesn't actually need to be an HTML web page. You should use the PKCE option, and use a redirect URI that goes directly to your app, e.g., by using a custom URL scheme that you register for your app.

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

5,888 PostsLatest Activity: 7 hours ago
326 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!