Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Authenticating Dropbox leaves open Browser

I'm trying to have my App upload a file on Dropbox and I downloaded their DBRoulette test program but I found also there the strange behavior I'm now gonna explain

Basically once you push the button for authenticating the App and authorize it to link with your Dropbox there's a command the library provides which is

private DropboxAPI mApi;

mApi.getSession().startAuthentication(context);

Once this command is processed the native browser opens and shows the buttons Deny or Allow to accept or not the authorization, but the problem is that when you press it, the App comes back and shows itself while the native browser lies in the background, ready to appear again once you exit from the app and this is rather annoying (though it does it only the first time you launch the app)

p.s. before I forget I DO use in the onResume the following code which is suggested in the tutorial

session.finishAuthentication();

Thanks to anyone who will help me understand this problem better and (hopefully) solve it redirecting the authorization in a Webview OR closing the native browser once the button is pressed and the authentication is processed

like image 722
kioli Avatar asked May 07 '12 14:05

kioli


1 Answers

Unfortunately, there is not much you can do about it.

The authentication process runs on the server-side, i.e. on Dropbox. That means that Dropbox defines the course of action for authenticating a user which you as the client have to follow. That's part of the idea of the OAuth authentication flow.

What I have experienced myself though is the fact that if you have the official Dropbox app installed, the app is used for authenticating the user (instead of the browser) and also gets closed after the user has pressed the allow/cancel button.

like image 153
jenzz Avatar answered Sep 23 '22 01:09

jenzz