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
donaldp
5 years agoCollaborator | Level 9
Sign-in stuck on my laptop - works perfectly on PC
Have downloaded a bunch of code updates to my laptop,which is currently connected to the same router as my PC (so minimal difference in IP address) and when I try to signin my app to Dropbox it is ju...
donaldp
Collaborator | Level 9
Hi Greg,
Ok, but that was how I was taught to do it and is the only way I know. Do you have some sample C#/.NET code for how to do it this other way? I don't see any in the link you gave me, nor any links within that.
thanks,
Donald.
Greg-DB
5 years agoDropbox Staff
Sure, there's more information and sample code in the documentation for DropboxOAuth2Helper in the .NET SDK.
- donaldp5 years agoCollaborator | Level 9
"A HttpListener is created to listen to the RedirectUri which will later receive redirect callback from the server. Start() is called to launch a native browser and navigate user to the authorize URI".
Hmmm, I remember now trying to do this back in the beginning (because it was in your .NET code) and never succeeded in getting it working. Will have another look at it though. Thanks.
- donaldp5 years agoCollaborator | Level 9
Hey Greg,
Ok, I've gone back and revisited the code I never got working, which was based on SimpleTest. Where I got stuck was stuff around index.html in HandleOAuth2Redirect. At the time you said it wasn't really necessary (just a page that is displayed to the user, which I don't need), and I think I have an idea now how to resolve that, however the way I did get it working in the end, following someone's blog, was using
OAuth2Response result=DropboxOAuth2Helper.ParseTokenFragment(new Uri(e.Url));
in a webview, which is way simpler (much fewer lines of code) than the way it's done in SimpleTest (ParseTokenFragment does all the heavy lifting for you). Would I be able to use that with this different approach? i.e. once I get to http.Start(), what would the next few lines of code look like if I wanted to use ParseTokenFragment instead? (and if this is indeed possible, maybe update SimpleTest to reflect this simpler approach?)
thanks,
Donald.
- Greg-DB5 years agoDropbox Staff
Using a web view for the app authorization flow is not officially supported, so I can't recommend doing so.
In any case, if you call ParseTokenFragment and it returns successfully, the return value will be a OAuth2Response. You can get the access token from OAuth2Response.AccessToken.
- donaldp5 years agoCollaborator | Level 9
"Using a web view for the app authorization flow is not officially supported, so I can't recommend doing so"
Ok, I understand that. I'm asking if you can use ParseTokenFragment with a native browser (as per your recommendation), and if so what would the code to do so look like?
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,915 PostsLatest Activity: 2 days agoIf 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!