We Want to Hear From You! What Do You Want to See on the Community? Tell us here!

Forum Discussion

venkatesh_sana's avatar
venkatesh_sana
New member | Level 2
7 years ago

How to create a Dropbox Authorization to build our own app using c#

To build our own app we are creating a dropbox account we are  calling to a dropbox api in that i didnt get the complete details for creating the developer account here is the syntax of the dropbox api : "https://www.dropbox.com/1/oauth2/authorize?client_id="+<app key>&response_type=code&redirect_uri=<redirect URI>&state=<CSRF token> .

I didnt get about the state parameter like state=<CSRF token> how to get that csrf token and how to authentcate and get the access token and refresh token.

1 Reply

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

    Dropbox uses OAuth 2 to handle app authorization. You can find more information on how the OAuth flow works in the OAuth guide, and you can find the documentation for our OAuth 2 endpoints here. Note that Dropbox only uses access tokens, not refresh tokens. 

    The state parameter is:

    "Up to 500 bytes of arbitrary data that will be passed back to your redirect URI. This parameter should be used to protect against cross-site request forgery (CSRF). See Sections 4.4.1.8 and 4.4.2.5 of the OAuth 2.0 threat model spec."

    To protext against CSRF attacks, the value should be unguessable, random, arbitrary data that your app generates. Please refer to the above links for more information. You can additionally use it to store any application state you need to pass through the app authorization flow.

    We highly recommend using one of the official SDKs though, such as the official Dropbox API v2 .NET SDK, as they do most of the work for you.

About Discuss Dropbox Developer & API

Node avatar for Discuss Dropbox Developer & API
Make connections with other developers814 PostsLatest Activity: 2 days ago
276 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!