cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
We want to hear from you. What do you use Dropbox for?
Close

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted

OAuth2 with IWebBrowser2

Helpful | Level 5

Hi. I am doing some app in C++ using IWebBrowser2 for authenticating user. The problem is that this browser component does not allow catching redirects so in the end of the either code or token flow the component just shows "cannot display the page <my redirect uri>"

For such stupid components like IWebBrowser2 Google Docs API, for example, allow returning of some special web page (instead of redirecting) with stable format so the app can parse it and get the auth code.

Please advice me if using code flow with no redirect uri is what I need? I mean, if the format of the returned page is stable so I can rely on it and parse it to find the auth code?

1 Accepted Solution

Accepted Solutions
Highlighted

Re: OAuth2 with IWebBrowser2

Helpful | Level 5

Hi Stephen. Thank you for response.

I read about this way but ideally my app would connect to Dropbox without need of user's copy-paste.

Anyway, I managed to beat the IWebBrowser2 to work with Dropbox OAuth2 flow. Eventually, for some URIs it gives correct address and https://www.dropbox.com/1/oauth2/redirect_receiver appeared to be one of them.

View solution in original post

2 Replies 2
Highlighted

Re: OAuth2 with IWebBrowser2

Dropboxer
Dropboxer

Hi Andrii, you might try simply hitting the https://www.dropbox.com/1/oauth2/authorize endpoint without without passing the 'redirect_uri' web parameter. 

The desired url might look something like this:

https://www.dropbox.com/1/oauth2/authorize?client_id=<CLIENT APP KEY>&response_type=code

This will return a response with an OAuth code embedded in the page content without triggering a redirect. 

With regard to your question about page stability, we make no guarantees that the html content that we return will not change. Therefore, we recommend that you do not resort to parsing the response page to retrieve the OAuth token.

Highlighted

Re: OAuth2 with IWebBrowser2

Helpful | Level 5

Hi Stephen. Thank you for response.

I read about this way but ideally my app would connect to Dropbox without need of user's copy-paste.

Anyway, I managed to beat the IWebBrowser2 to work with Dropbox OAuth2 flow. Eventually, for some URIs it gives correct address and https://www.dropbox.com/1/oauth2/redirect_receiver appeared to be one of them.

View solution in original post

Polls
Do you know how to organize your files and folders?
<b>We have created a guide on folder best practice, so you can get organized now <a href="https://www.dropboxforum.com/t5/Business-Tips-tricks/Folder-structure-best-practice/m-p/428456#M39"><u>check it out here</u></a>.</b>

Work Smarter with Dropbox

The way we work is changing. Share and discover new ways to work smarter with Dropbox in our community.

Sound good? Let's get started.
Who's talking

Top contributors to this post

What do Dropbox user levels mean?
Need more support?