Your workflow is unique 👨‍💻 -  tell us how you use Dropbox here.

Forum Discussion

YOUNGGON K.'s avatar
YOUNGGON K.
New member | Level 1
10 years ago

Fail to load oauth2/authorize page

According to API document, I tried to load authorization page with parameters like below.
(covered client_id for privacy)
 
https://www.dropbox.com/1/oauth2/authorize?client_id=<client_id>&redirect_uri=x-agent%3A%2F%2Fdropbox_callback&response_type=code&state=MTQ0NzE0MTkyNTc3MQ%3D%3D
 
The page returned 400 HTTP status error code with message: We can't find the page you're looking for. Check out our Help Center and forumsfor help, or head back to home.
 
My developer account has 'Full Dropbox' permission.
So, I don't think permission problem.
Moreover, client_id, redirect_uri, response_type were right.
state parameter also was encoded by Base64.
 
Did I something miss?
 
Thanks for your support in advance.

7 Replies

Replies have been turned off for this discussion
  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    10 years ago

    Thanks for the report. We're looking into it.

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

    Ok, the /authorize page should be behaving properly now, and returning useful error messages.

    For example, in this case, you should get:

    "More details for developers

    Invalid redirect_uri: "x-agent://dropbox_callback": When response_type=code, redirect_uri must start with "https://", unless it's a localhost URI."

  • Fábio P.1's avatar
    Fábio P.1
    New member | Level 1
    9 years ago

    I am with almost the same problem...

    Invalid redirect_uri. When response_type=code, redirect_uri must start with "https://", unless it's a localhost URI.

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

    Hi Fábio, can you elaborate on the issue you're seeing? It sounds like you are properly seeing the error message on the /authorize page. OAuth 2 redirect URIs for the "code" flow do need to start with "https://", unless it's a localhost address.

  • Fábio P.1's avatar
    Fábio P.1
    New member | Level 1
    9 years ago

    Gregory, the thing is.
    I am trying to install the R package "rdrop2" in a server here.
    When I try the command:
    dropbox_credentials <-
    drop_auth()
    drop_auth(new_user = T, key="mykey", secret="mysecretcode", cache=TRUE) ##

    I already have created the app in Dropbox

    The shell send me the follow message:

    > drop_auth()
    httpuv not installed, defaulting to out-of-band authentication
    Please point your browser to the following url:

    https://www.dropbox.com/1/oauth2/authorize?client%5Fid=mmhfsybffdom42w&scope=&redirect%5Furi=urn%3Aietf%3Awg%3Aoauth%3A2%2E0%3Aoob&response%5Ftype=code

    Enter authorization code: ????

    But I am not able to access this page...

     

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

    The redirect_uri being supplied in that /authorize URL is: "urn:ietf:wg:oauth:2.0:oob". That doesn't start with https://, and as such isn't allowed by Dropbox's OAuth 2 implementation, per the error message. You'll need to use an https:// (or localhost) redirect URI instead. 

    If it's helpful for your case, Dropbox provides a receiver page at: https://www.dropbox.com/1/oauth2/redirect_receiver

  • Fábio P.1's avatar
    Fábio P.1
    New member | Level 1
    9 years ago
    I discovered that I did not have this package:
    # install from CRAN
    install.packages("httpuv")

    Now, it is working, and it is authenticating automaticly.

     

    Thank you Gregory.

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!