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

Forum Discussion

Brendan C.'s avatar
Brendan C.
New member | Level 1
11 years ago

Hardcode authentication/api to a single Dropbox account?

Hello - new to the Dropbox API and wondering if it's possible to hardcode the Dropbox account that an app using the API would authenticate/connect to?

In other words - when a user takes some action in my app - I want to save the file output of that action to MY Dropbox account, not ask them to authenticate into their account.

Let me know if that doesn't make sense!

Thanks,
Brendan

3 Replies

Replies have been turned off for this discussion
  • Jason C.'s avatar
    Jason C.
    New member | Level 1
    11 years ago

    I would recommend you to have a server to automatically upload files to your dropbox, rather than hard-coding your keys and keys in your app which could potentially allow people to upload whatever they want (malware, executables) and how much they want.

    If you really want hard code your keys, you can try using the OAuth API https://www.dropbox.com/developers/core/docs to generate a key, and then hardcode that key for requests in your app.

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

    The API was designed with the intention that each user would link their own Dropbox account, in order to interact with their own files. However, it is technically possible to connect to just one account. The SDKs don't offer explicit support for it and we don't recommend doing so, for various technical and security reasons.

    However if you did want to go this route, instead of kicking off the authorization flow, you would manually use an existing access token for your app. (Just be careful not to revoke it, e.g. via https://www.dropbox.com/account/security .)

  • Brendan C.'s avatar
    Brendan C.
    New member | Level 1
    11 years ago

    @Jason yep, that makes sense, but doing everything client side for this app since I'm being lazy and trying to build a prototype.

    @Greg K - got it yeah, kinda figured that, so would need to get a valid token and then hardcode that into the flow... I understand the risks there of course...

    I'm basically trying to use dropbox as a file server that can receive a new file then spit out a dl link that can be shared, kind of a janky use case.

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!