Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
Hi
My goal is to get files by DropBoxRest API in C#
Here is my code
var options = new Options
{
ClientId = "", //App key
ClientSecret = "", //App secret
RedirectUri = "https://www.dropbox.com/1/oauth2/authorize"
};
// Initialize a new Client (without an AccessToken)
var client = new Client(options);
// Get the OAuth Request Url
var authRequestUrl = await client.Core.OAuth2.AuthorizeAsync(access_token which generated in my account);
// TODO: Navigate to authRequestUrl using the browser, and retrieve the Authorization Code from the response
var authCode = ""; Which code have to be here ???
// Exchange the Authorization Code with Access/Refresh tokens
var token = await client.Core.OAuth2.TokenAsync(authCode); in this line occured the following error
//An unhandled exception of type 'System.AggregateException' occurred in mscorlib.dll
// Get account info
var accountInfo = await client.Core.Accounts.AccountInfoAsync();
Please give me an advice
You could do this, but I would advise against it. Dropbox isn't designed for this kind of account sharing, and anyone who had access to your app would be able to extract the access token and take control of the account (e.g. delete all the files).
I totally agree with you. But others users can't have an access to our access_token because they have to use only exe.
If the access token is in the exe file, it can definitely be extracted. (As a potentially easier alternative, a user could just set up an HTTP proxy and look at the Authorization header.)
Thank you for the answer.
Can you please explain this
As a potentially easier alternative, a user could just set up an HTTP proxy and look at the Authorization header
I mean that if a user wants to get the access token, they can just run an HTTP proxy (like Fiddler2) and see the Authorization header your app is sending to Dropbox. The access token will be plainly visible there.
My general point is that if you put the access token in the app, users can get it.
Thanks. Ok. So what you advice ? how we can use dropbox in this case?
My advice would be to not use Dropbox. The Dropbox API is primarily meant to be used in apps where each user will access his or her own account.
Thanks. But I have no choice to create new API and I have no other server. So I don't know what can I do except of DropBox
hi All
I.m getting the following error
Dropbox Rest API.Services.Core.OAuth2 does not contain definition for AuthorizeAsync
Velmurugan, please post a new question instead of replying to an old thread.
Hi there!
If you need more help you can view your support options (expected response time for a 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!