cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Whether you are transferring a single drive, a team or an entire organization, Movebot's cloud migration tool has been built to make your Dropbox migration simple - learn all about it 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: 

API oauth code/token storage php

API oauth code/token storage php

FSUInnovation
Explorer | Level 4

What array variable get returned to following the redirect uri upon a successful oauth2 flow on my app? Is it stored in a variable like $_GET['code'] or something like that? I tried checking for it in a variable and I recieved a error that the variable did not exist.

1 Accepted Solution

Accepted Solutions

Re: API oauth code/token storage php

Greg-DB
Dropboxer

You can find examples of the information included on the redirect URI after the user authorizes the app in the /oauth2/authorize documentation, under the "Returns" section:

https://www.dropbox.com/developers/documentation/http/documentation#oauth2-authorize

Specifically, there is a "Sample response" for both the code and token flow.

Note that for the code flow, the values are passed as URL parameters, so they do get sent to your server. Exactly how the URL parameters are made available to your will depend on the web framework you're using, so I can't offer detailed insight on that. I recommend referring to the documentation for your web framework.

For the token flow, they are passed on the URL fragment, and so do not get sent to your server.

 

View solution in original post

3 Replies 3

Re: API oauth code/token storage php

Greg-DB
Dropboxer

You can find examples of the information included on the redirect URI after the user authorizes the app in the /oauth2/authorize documentation, under the "Returns" section:

https://www.dropbox.com/developers/documentation/http/documentation#oauth2-authorize

Specifically, there is a "Sample response" for both the code and token flow.

Note that for the code flow, the values are passed as URL parameters, so they do get sent to your server. Exactly how the URL parameters are made available to your will depend on the web framework you're using, so I can't offer detailed insight on that. I recommend referring to the documentation for your web framework.

For the token flow, they are passed on the URL fragment, and so do not get sent to your server.

 

Re: API oauth code/token storage php

FSUInnovation
Explorer | Level 4

I use php with an apache and mysql server. I don't have any framework like laravel that I use.

Re: API oauth code/token storage php

Greg-DB
Dropboxer

In that case I recommend checking the documentation for how to access the URL parameters for the URL from Apache in PHP. Those aren't made by Dropbox so unfortunately I can't provide specific guidance for that. (It sounds like you're making a web app though so do make sure you are using you're using the "code" flow and not the "token" flow.)

Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropboxer
  • User avatar
    FSUInnovation Explorer | Level 4
What do Dropbox user levels mean?
Need more support?