Need to see if your shared folder is taking up space on your dropbox 👨‍💻? Find out how to check here.

Forum Discussion

andrewnicols's avatar
andrewnicols
Helpful | Level 5
5 years ago
Solved

OAuth2 empty scope does not behave correctly

According to the OAuth2 Authorization documentation , the `scope` is a nullable String:

 

scope String? This parameter allows your user to authorize a subset of the scopes selected in the App Console. Multiple scopes are separated by a space. If this parameter is omitted, the authorization page will request all scopes selected on the Permissions tab. Read about scopes in the OAuth Guide.

 

This matches RFC6749 section 3.3 which states:

   If the client omits the scope parameter when requesting
   authorization, the authorization server MUST either process the
   request using a pre-defined default value or fail the request
   indicating an invalid scope.  The authorization server SHOULD
   document its scope requirements and default value (if defined).

 

However, the Dropbox API treats the nullable state incorrectly:

  • If the scope is provided, but is empty, then a 400 error message is displayed; but
  • if the scope is missing entirely then the default value is provided.

Section 3.1 of the RFC states:

   Parameters sent without a value MUST be treated as if they were
   omitted from the request.  The authorization server MUST ignore
   unrecognized request parameters.  Request and response parameters
   MUST NOT be included more than once.

It seems that the Dropbox authorization endpoint is mis-treating the value, causing the 400 error. Per the specification, a parameter with an empty value MUST be treated in the same way as an omitted parameter.

8 Replies

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    5 years ago

    Thanks for the detailed writeup! That's very helpful. I'll ask the team to update the implementation to treat an empty scope parameter the same way as a missing scope parameter.

  • andrewnicols's avatar
    andrewnicols
    Helpful | Level 5
    5 years ago

    Thanks for the update Greg-DB!

     

    I look forward to the change. I'll mark this as accepted once there's a response as to if/when that will be implemented.

     

    Cheers

  • andrewnicols's avatar
    andrewnicols
    Helpful | Level 5
    5 years ago

    Hi Greg-DB,

     

    I was just wondering whether there's any update from the relevant team on the state of this and an ETA for a fix?

     

    Thanks,

     

    Andrew

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    5 years ago

    I don't have an update on this quite yet, but I'll follow up here once I do.

  • andrewnicols's avatar
    andrewnicols
    Helpful | Level 5
    5 years ago

    Hi Greg-DB,

     

    I'm just wondering whether you have an update to this issue yet? It's been over a month now.

     

    Thanks,

     

    Andrew

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    5 years ago

    andrewnicols This is still open with the team, but I don't any news on this yet. I'll let you know when I do.

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    5 years ago

    andrewnicols The team has made this change and it is rolling out now. Hope this helps! 

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.

The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.

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, Facebook or Instagram.

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!