cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to know what we learned at IBC? Check out our learnings on media, remote working and more right here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Calling startOAuth2Authentication browser never closes and return to my app

Calling startOAuth2Authentication browser never closes and return to my app

DannyW
New member | Level 2

Update

After many tests I found that the Browser on the device is outdated.  I installed the latest Chrome browser and the problem still persist.  The only browser that is working is Firefox.

Is there problem with Dropbox api and specific version of the browser/Android OS?

----------------------------------------------------

I have custom Android  device running api 22. It does not have the normal Android OS version number. eg: 5.0.xxx   It is customized.  My app is using Dropbox api v2.

compile 'com.dropbox.core:dropbox-core-sdk:3.1.3'

 

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.quirklogic.dropboxdemo"
        minSdkVersion 21
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
         testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}

 

When I call

 

Auth.startOAuth2Authentication(getApplicationContext(), getString(DROPBOX_APP_KEY));

The browser is opened and when I entered my email and password to authenticate there are is error.  It never shows the permission screen and the browser never closes and return to my app.

I do get logcat errors.

03-03 13:56:02.805 3531-3531/com.android.browser I/browser: Console: The Content-Security-Policy directive 'base-uri' is implemented behind a flag which is currently disabled.
     https://www.google.com/recaptcha/api2/anchor?ar=1&k=6LeQblAUAAAAAHIxpoTyzyKHd_2AbdDjSGcyhHSJ&co=aHR0cHM6Ly93d3cuZHJvcGJveC5jb206NDQz&hl=en&v=v1QHzzN92WdopzN_oD7bUO2P&size=invisible&sa=LOGIN&cb=2xdliulnzfg9:0
03-03 13:56:03.213 3531-3531/com.android.browser I/browser: Console: The Content-Security-Policy directive 'base-uri' is implemented behind a flag which is currently disabled.
     about:blank:0
03-03 13:56:03.214 3531-3531/com.android.browser I/browser: Console: The Content-Security-Policy directive 'base-uri' is implemented behind a flag which is currently disabled.
     about:blank:0
03-03 13:56:03.664 3531-3531/com.android.browser I/browser: Console: The Content-Security-Policy directive 'base-uri' is implemented behind a flag which is currently disabled.
     about:blank:0
03-03 13:56:03.667 3531-3531/com.android.browser I/browser: Console: The Content-Security-Policy directive 'base-uri' is implemented behind a flag which is currently disabled.
     about:blank:0
03-03 13:56:03.751 3531-3531/com.android.browser E/browser: Console: Warning: StoreListener(Unknown): isMounted is deprecated. Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks. https://cfl.dropboxstatic.com/static/js/packaged/pkg-react-libs.min-vflFbcDTf.js:1

 

I have tested the same app on Android OS7+ and it works fine and the browser ask for permission and then returns to my app.

If have select to sign in using Google account and then select an account from the list then it works.  It will NOT work if I authenticate using userid/password.

I have also tried the sample app here and it does not work either.

https://github.com/dropbox/dropbox-sdk-java/tree/master/examples/android/src/main/java/com/dropbox/c...

9 Replies 9

Greg-DB
Dropbox Staff

Thanks for the report! It sounds like there may be an incompatibility in some cases with Chrome. I just tried the Dropbox Java SDK's Android sample app as well though, and it worked for me, redirecting back to the sample app without issue. I just tried it with Chrome 80.0.3987.119 in particular. You mentioned you tried it with the latest version of Chrome, but can you let me know what version number of Chrome specifically?

DannyW1
Explorer | Level 3

HI Greg,

I'm using Chrom v80.0.3987.119 too.  As i have mentioned i'm using a customized Android OS build and is at API 22.  The device DOES NOT have Google Services installed.  It is very barebone OS.

The app works fine if I select signin using Google but not when signing in using email/password. 

The device also comes with a stock Browser app com.android.browser version 1.6.02.06240 which DOES NOT work either.

However, my app works fine with Firefox version 68.6.0

 

Greg-DB
Dropbox Staff

Thanks for the information. I just tried this on an Android emulator running API 22 with the built in browser (though it's reporting a different kind of version number: 5.1.1-552941) and that also worked for me.

Do you have access to a device running a non-customized API 22? It would be useful to know if it does or doesn't reproduce for you there.

It's still unclear what the exact issue is, or what, if anything we can do about it, since it seems to be browser-specific, but in any case we'll need to be able to reproduce the issue first.

DannyW1
Explorer | Level 3

Greg,

The Android device that we have do not have the standard OS version numbering so i can't even give you that. It is 1.6.xxxxx which is customized for the device.  We can not upgrade the OS either.

The problem is when the browser displays the sigin in screen.  I select use another account.  I then enter a email and password to auth.  It then just sat there infinite loop.

 

Greg-DB
Dropbox Staff

Is there a way for us to replicate that environment so we can reproduce the issue here?

DannyW1
Explorer | Level 3

Greg,

It would be very difficult since I would have to send you the device to test.

Is there a debug option for the Dropbox SDK that I can see what is happening during browser authentication ?

Here is the video of my sample app. Note that the end of the video it just stuck and never returns.

Link https://drive.google.com/open?id=1gVZ-3lmEz9Eexr6LQ998NmxlBYTWtr-T

 

Greg-DB
Dropbox Staff

Unfortunately there isn't any extra debug option built into the SDK, and anything like that wouldn't really help in this case since the issue is happening in the browser itself.

For browser issues, we would look for JavaScript error information, which you already provided in your original message. Nothing in that output looked necessarily relevant though. It all just seemed to be at the informational or warning level, not any actual errors.

To double check though, since you mentioned you got that from Logcat, you might want to try using remote debugging to check the JavaScript console, as well as the Network tab, to see if there is any other useful error information.

Additionally, just to clarify, does the issue when using the latest version of the Chrome browser on the device look exactly the same as seen in Browser as shown in this video?

DannyW1
Explorer | Level 3

Thanks Greg. We will try to see if we can access to more debug info.

Yes.  On the lastest Chrome browser it is exactly as the native Browser that is installed on the device.  I did try using CustomTabIntent and same problem.  I even tried using the REST call https://www.dropbox.com/1/connect?.... and still same problem.

Why does it work on Firebox and not other browsers?

Greg-DB
Dropbox Staff

Thanks, please let me know if you get any more error information.

Also, https://www.dropbox.com/1/connect?... is just a web site and not something you would call programmatically.

Anyway, at this point I don't have enough insight on the issue to say exactly it would work in some browsers and not others (and only on some systems, for that matter). And on that point, it may be useful to know if it also occurs with the latest version of Chrome on your system when trying to log in to just https://www.dropbox.com/login itself.

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    DannyW1 Explorer | Level 3
What do Dropbox user levels mean?