cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox 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: 

Java SDK - Android - Log in error: "Couldn't connect to Dropbox"

Java SDK - Android - Log in error: "Couldn't connect to Dropbox"

Ernie T.1
Explorer | Level 4
Go to solution

My old code uses tokens that now expire after 4 hours.  I'm trying to update my Android/Java code to fix this, but I'm having trouble getting past the login ("Allow") screen.

 

My OLD auth code is below, and works, but expires after 4 hours:

Auth.startOAuth2Authentication(activity, appKey);

My NEW code looks like below.  I get a login screen that says, "(app) would like access to...."  But when I tap "Allow" in this final Dropbox login screen , I get an error which I think it coming from Dropbox (before control is returned to my Activity): "Couldn't connect to Dropbox. Please make sure you have an internet connection and try again."  I'm running on actual device.

List<String> scopes = Arrays.asList("account_info.read", "files.content.write");
Auth.startOAuth2PKCE(activity, appKey, getConfig(), scopes);

 

 My Dropbox "apps" are many years old, so not sure if this has something to do with the error. 

I'm not sure how to continue.  Any help would be appreciated.

 

I created a new Dropbox App with Permission Type: "Scoped App", and it works.  So it seems Auth.startOAuth2PKCE is not working with my older pre-"scoped" apps.

 

Ernie

1 Accepted Solution

Accepted Solutions

Greg-DB
Dropbox Staff
Go to solution

Are you using an app key for an app that hasn't been migrated to scopes yet? This can occur if so. (Apologies for the unhelpful error message!) In order to use the updated app authorization flow, you'll need to use an app key for an app that is set to use scopes.

 

You can migrate an existing app to scopes via the app's page on the App Console.

View solution in original post

2 Replies 2

Greg-DB
Dropbox Staff
Go to solution

Are you using an app key for an app that hasn't been migrated to scopes yet? This can occur if so. (Apologies for the unhelpful error message!) In order to use the updated app authorization flow, you'll need to use an app key for an app that is set to use scopes.

 

You can migrate an existing app to scopes via the app's page on the App Console.

Ernie T.1
Explorer | Level 4
Go to solution

Thanks!

 

(I edited post to remove a question.  All sorted.  I'll see if my tokens continue to work after 4 hours....)

 

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Ernie T.1 Explorer | Level 4
  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?