Start 2025 on time and up to date! Seamlessly integrate your calendars into Dropbox with these simple steps! 📆

Forum Discussion

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

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.