Forum Discussion

raymondc's avatar
raymondc
New member | Level 2
4 years ago
Solved

Andriod App to Only use short tokens

Hello,

 

All this is quite new to me but I've read many post regarding new workflow. Thus, sorry if what I am saying makes no sense.

 

I've read that using startOAuth2PKCE uses the new flow. However, this uses refresh tokens as well. What happens if I just want to use short lived tokens and ask the user to re-authenticate when the short lived tokens expires. Is there another function to use for that purpose?

  • No, the authorization functionality for Android in the Java SDK automatically requests "offline" access (i.e., to retrieve a refresh token), and doesn't offer the ability to configure that. I'll pass this along as a feature request, but I can't promise if or when that might be implemented.

     

    (For reference, the DbxWebAuth functionality does offer the ability to specify the token type, but that's not meant or built for use on Android.)

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Staff rankDropbox Staff

    No, the authorization functionality for Android in the Java SDK automatically requests "offline" access (i.e., to retrieve a refresh token), and doesn't offer the ability to configure that. I'll pass this along as a feature request, but I can't promise if or when that might be implemented.

     

    (For reference, the DbxWebAuth functionality does offer the ability to specify the token type, but that's not meant or built for use on Android.)

    • raymondc's avatar
      raymondc
      New member | Level 2

      Thank you for the quick reply.

       

      One more question.

       

      If I use this version of startOAuth2PKCE with scope set to null

      public static void startOAuth2PKCE(Context context, String appKey,
      DbxRequestConfig requestConfig) {

      Would this gives all permissions to do anything in dropbox(upload, download,...)?

       

       

      • Greg-DB's avatar
        Greg-DB
        Icon for Dropbox Staff rankDropbox Staff

        If you don't specify "scope", it will default to requesting the set of scopes enabled for your app (on the App Console) at the time of authorization.

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.5,950 PostsLatest Activity: 2 days ago
351 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!