Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
Gonzo345
9 years agoHelpful | Level 5
Facing problems getting the Access Token from a user on Windows Form
Hi there:
I actually asked this on StackOverflow but I got no answer yet. The thing is that I'm trying to generate the access token from the user but I can't "capture" the generated token and I...
- 9 years ago
You can retrieve an access token from the OAuth flow either using or not using a redirect URL, as you saw, but we recommend using a redirect URL when you can, as it streamlines the process.
(For reference, if you do copy/paste the code, note that that's an "authorization code" and not an "access token". You need to exchange it for an access token.)
Anyway, for the redirect version, it looks like you're seeing the event for the load of the /authorize page itself. That one should be ignored, as you're actually looking for the load after the user clicks to authorize the app, and is sent to the redirect URI. Is that event not firing at all for you?
Also, I notice you're using the "Navigating" event. You may want to try the "Navigated" event instead to see if that works better in your case. (We had a blog post about this here, although it wasn't written for use with the newer .NET SDK itself.)
Greg-DB
Dropbox Community Moderator
9 years agoYou can retrieve an access token from the OAuth flow either using or not using a redirect URL, as you saw, but we recommend using a redirect URL when you can, as it streamlines the process.
(For reference, if you do copy/paste the code, note that that's an "authorization code" and not an "access token". You need to exchange it for an access token.)
Anyway, for the redirect version, it looks like you're seeing the event for the load of the /authorize page itself. That one should be ignored, as you're actually looking for the load after the user clicks to authorize the app, and is sent to the redirect URI. Is that event not firing at all for you?
Also, I notice you're using the "Navigating" event. You may want to try the "Navigated" event instead to see if that works better in your case. (We had a blog post about this here, although it wasn't written for use with the newer .NET SDK itself.)
Gonzo345
9 years agoHelpful | Level 5
Holy s***, that was it. I changed the Navigated event and it was like magic...
I feel like a dumb, but it's finally working. It feels really weird, but it was worthy. I guess I wasn't thinking clear due to working all the time on this glitchy thing.
Thanks Greg!
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
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, Facebook or Instagram.
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!