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

DannyW's avatar
DannyW
New member | Level 2
5 years ago

Calling startOAuth2Authentication browser never closes and return to my app

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/core/examples/android

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Staff rankDropbox 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's avatar
      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's avatar
        Greg-DB
        Icon for Dropbox Staff rankDropbox 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.

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

5,910 PostsLatest Activity: 3 days ago
333 Following

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 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!