Cut the Clutter: Test Ignore Files Feature - sign up to become a beta tester  here!

Forum Discussion

Esikhoob's avatar
Esikhoob
Helpful | Level 5
3 years ago

What function in .NET SDK is for /oauth2/token

Hi

In our Website, written with ASP.NET and C#, we want to use .NET API in offline access manner. So I think we need to get access token by using refresh token. I read the documentation and find out we had to call  /oauth2/token for that. 

I use Dropbox`s .NET SDK, but it`s documentation is missing. My question is: what function should I call in .NET SDK to achive same functionlity as calling /oauth2/token.

Thankyou.

7 Replies

  • Esikhoob's avatar
    Esikhoob
    Helpful | Level 5
    3 years ago

    I think, you mean  DropboxClient class instance will do this job.

    I had to explain our goal more: We are adding Dropbox upload capability to our ASP.NET website. As a matter of fact, I have used java script SDK for achieving our goals , but  I think I should not put  app key or secret in java script, which will observable to all users.

    so I think, we will generate access token in server side (aka .NET), and send that to java script side.

    Is my assumption true? If yes, by reading the document I cannot find a way to get access token out of .NET SDK DropboxClient. how can I get it?

    thanks in advance.

     

  • Здравко's avatar
    Здравко
    Legendary | Level 20
    3 years ago

    Hi again Esikhoob,

    I see what you mean. Dropbox .NET SDK unfortunately is not designed in a way to be possible such things. The fields you're interested in are hidden/private. So no, you cannot use the provided SDK as is, but you can use the sources as a template and re-implement it (with some slight changes - expose needed access token with some method for instance) so you can get access token after you make sure it's actual (using the proper method). You don't need a client object if you don't plane make regular API calls server side. The only object you need, in such a case, is DropboxRequestHandler class instance (after the class modification or another derived class declaration). 😉

    Hope this gives direction.

  • Esikhoob's avatar
    Esikhoob
    Helpful | Level 5
    3 years ago

    Thanks all for these helping answers.

    Greg-DBI read PKCE documentation, but I don`t understand the purpose of eliminating app secret, since others also can call the API without it.

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.6,037 PostsLatest Activity: 3 hours ago
412 Following

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 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!