Forum Discussion

tecnicxci's avatar
tecnicxci
Helpful | Level 5
3 years ago
Solved

Unable to connect to dropbox using the dropbox api to give access to and account

I have updated and app to use the dropbox sdk version 5.2.0, before it used the 4.0.1.

The problem I have now is that when I do:

 

 

DbxRequestConfig requestConfig = new DbxRequestConfig(clientIdentifier);
Auth.startOAuth2PKCE(mContext, APP_KEY, requestConfig, scopes);

 

 

The app launches the popup dialog to allow an account, but when selecting allow, the popup response with an error saying that it could not connect, I have access to the internet and before updating the sdk this popup dialog worked fine.

Here I attach images to show the error:

 
 

 

 

  • The problem was with the scopes I removed this lines and all worked fine:

    List<String> scopes = new ArrayList<>();
    scopes.add("account_info.read");
    scopes.add("files.content.write");
  • tecnicxci's avatar
    tecnicxci
    Helpful | Level 5

    The problem was with the scopes I removed this lines and all worked fine:

    List<String> scopes = new ArrayList<>();
    scopes.add("account_info.read");
    scopes.add("files.content.write");
    • Greg-DB's avatar
      Greg-DB
      Icon for Dropbox Staff rankDropbox Staff

      Thanks for following up. I'm glad to hear you got this working already.

       

      For reference, it sounds like you're using an app key for an app that hasn't been migrated to scopes yet. This can occur if so if you request scopes. (Apologies for the unhelpful error message!) In order to use the updated app authorization flow to request scopes, you'd 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.