cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

how to get Responce_type in client side?

how to get Responce_type in client side?

Ashish1
Explorer | Level 3

Hi  Team

 Thanks in advance .i am working on mvc application and got some requirtment to attach   a file from drop box.i m useing drop box api where i need to redirect page  to  "https://www.dropbox.com/oauth2/authorize? client_id=___&redirect_uri=__/Auth&response_type=code"  to this url for authorization  and as retrun i get a code in the redirect_uri   to get acess token.but while calling this url my page get refresh and i loose my form value  as it redirect me to login page of dropbox.

is there is any solution  to handle this type of situation or can we get acess code from client side without refreshing the url?

 

Thanks.

 

4 Replies 4

Greg-DB
Dropbox Staff
You do need to send the user to the /oauth2/authorize page for them to authorize your app, so you can't get an authorization code directly on your own page.

Instead though, you could look into either:

1) sending them there in a pop-up or new tab/window, so that they don't lose the contents of your page

or

2) saving the relevant page state somewhere, such as in local storage or a cookie, or by sending it through the Dropbox OAuth app authorization flow in the 'state' parameter, as documented here: https://www.dropbox.com/developers/documentation/http/documentation#oauth2-authorize

Ashish1
Explorer | Level 3

Hi

Thanks for your reply but opening in new pop up will load  the same page in current pop up not in the parent pop up box.

saveing data in local storage could be headche as form data may be too much.

is there ia any other solution?

Greg-DB
Dropbox Staff
I listed everything that came to mind in my last post. I recommend using the "state" parameter on /oauth2/authorize.

Ashish1
Explorer | Level 3

ok


@Greg-DBwrote:
I listed everything that came to mind in my last post. I recommend using the "state" parameter on /oauth2/authorize.


.Thanks  🙂

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Ashish1 Explorer | Level 3
  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?