We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
Melisek
4 years agoExplorer | Level 3
Token refreshing C#
I'm building an app in .net and accessing the app's folder for resources. So far everything is going smoothly, but i have no idea how to refresh the token in my app. I tried using the example code fr...
Здравко
4 years agoLegendary | Level 20
Hi Melisek,
Are you certain that Windows machine, used as a DUT, has properly set default web browser? 🧐 Try set it anew or change to some other. If no luck yet, test again with a bit changed 'authorizeUri'. Add to following line:
Melisek wrote:...
... System.Diagnostics.Process.Start(authorizeUri.ToString());
...
...a real browser name to avoid relying on system settings (possibly broken). It can come up something like:
System.Diagnostics.Process.Start("firefox", authorizeUri.ToString());Of course, other web browser can be used (on your opinion) too!
Let see the result...🤔
Greg-DB
Dropbox Community Moderator
4 years agoMelisek Thanks for following up. As Здравко said, please make sure the environment has a default web browser set.
Otherwise, it looks like you may be using Windows Forms, so please refer to this post for options, as it appears you may need to use something other than System.Diagnostics.Process.Start in that environment.
- Melisek4 years agoExplorer | Level 3
Yes i'm using WPF.
After giving the full path to the browser executable, it opens in the browser with the authorization site and for some reason opens two tabs passing into the URLS: http://files.content.read and http://account_info.read. But after allowing the app in the authorization site it throws this exception:
Exception thrown: „System.IO.FileNotFoundException” in System.Private.CoreLib.dll
Exception thrown: „System.IO.FileNotFoundException” in System.Private.CoreLib.dll
Could not find file 'C:\Programming\C#\MelisekGameManager\MelisekGameManager\bin\Debug\net6.0-windows\index.html'.: Error: {0}I think it's probably because i used the OauthBasic instead of OauthPKCE.
- Здравко4 years agoLegendary | Level 20
Seems improper argument quoting. Space chars are used as a scopes separator, but the same chars are arguments separators too. Try following version:
System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo(authorizeUri.ToString()) {UseShellExecute = true});I believe, now it's gonna work. 😉
Good luck.
- Melisek4 years agoExplorer | Level 3
Replaced it and it's still the same (i added the path to the browser). Checked it on another browser just in case, and it persists on there too.
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!