Discuss Dropbox Developer & API
Hi.
I've moving my Xamarin app to UWP.
In my Xamarin app I use this method of authentication
https://gist.github.com/thomashagstrom/b0856a383bcdcf905c7a774c8c1b0879
The trick is
webView.Navigating += this.WebViewOnNavigating;
But.
In UWP webView has no Navigating event (see https://docs.microsoft.com/en-us/uwp/api/windows.ui.xaml.controls.webview?view=winrt-18362)
So, how can I let user of my app to login to his/her dropbox account from my UWP app?
Can you show me a working example?
Aurangzeb.
If I understood you correctly, I think usrs don't log in thier accounts from your app. You simply grant them access to your APP (in app console) in YOUR dropbox account under [App Console].
In order to allow arbitrary end-users to connect your app to their own Dropbox accounts, you should implement the OAuth app authorization flow. Note however that this should no longer be processed in a web view. This should only be done via the user's system browser, per the documentation.
I don't believe we have an example for doing this in UWP in particular, but there is a general example with some code in the DropboxOAuth2Helper class documentation for the official Dropbox API v2 .NET SDK.
@Greg-DB wrote:In order to allow arbitrary end-users to connect your app to their own Dropbox accounts, you should implement the OAuth app authorization flow. Note however that this should no longer be processed in a web view. This should only be done via the user's system browser, per the documentation.
I don't believe we have an example for doing this in UWP in particular, but there is a general example with some code in the DropboxOAuth2Helper class documentation for the official Dropbox API v2 .NET SDK.
I think he was asking about something else, I think he wants the user to be able to use the app in order to log into user's personal account including shared files. I don't think this is possible according to OAuth2 which prevent using one's password through token flow method.
Maybe generating a link to the user's account is more suitable. [I guess]
@evry1falls I'm not sure I understand your comment. The information in my comment does refer to using the OAuth 2 app authorization "token" flow to allow the end-user to connect the app to their own personal Dropbox account, including shared files, without giving their password to the app. Implementing the OAuth 2 app authorization flow to allow end-users to authorize the app is the intended design.
If I understand correctly though, the original question was about how to migrate this flow from a webview in Xamarin to a webview in UWP, but I pointed out that it should actually be processed in the system browser, not a webview.
I'm sorry if I seemed arguemental.
Im sure you know what you are talking about.
@Greg-DB wrote:If I understand correctly though, the original question was about how to migrate this flow from a webview in Xamarin to a webview in UWP, but I pointed out that it should actually be processed in the system browser, not a webview.
I also changed the original code for my desktop project to display the Auth page in webbrowser control that I use, not the default webbrowser of the machine, it is working fine, I see no reason why you suggested otherwise. Could you explain it more?
@evry1falls Per the /oauth2/authorize documentation, the Dropbox OAuth app authorization flow should be processed in the system browser, not a web view. There's more information linked there, but in short, this is both to comply with Google's policy (since Dropbox offers Google Sign In as an authentication option), as well as for compatibility with the Dropbox site in general. While it may currently work in the control you're using, we've found web views to be more prone to incompatibilities, and since they're not officially supported by the Dropbox site, we can't promise fixes if/when such issues arise.
@Greg-DB wrote:@evry1falls Per the /oauth2/authorize documentation, the Dropbox OAuth app authorization flow should be processed in the system browser, not a web view. There's more information linked there, but in short, this is both to comply with Google's policy (since Dropbox offers Google Sign In as an authentication option), as well as for compatibility with the Dropbox site in general. While it may currently work in the control you're using, we've found web views to be more prone to incompatibilities, and since they're not officially supported by the Dropbox site, we can't promise fixes if/when such issues arise.
Thank you.
May I ask you to send that part of Google's policy that requires DropBox to stop supporting the Web Authentication Broker?
Hi there!
If you need more help you can view your support options (expected response time for a 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!