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: 

Obtaining authorization token with code flow

Obtaining authorization token with code flow

sbartan
Explorer | Level 4

I'm trying to obtain authorization token with code flow. I'm using spatie/flysystem-dropbox in laravel. I'm redirected to my site, with code parameter in url, but i can't get my token.Zrzut ekranu 2020-08-21 o 11.41.21.png

 

I recieve this error: 

{"error_description":"No auth function available for given request","error":"invalid_request"}

 

3 Replies 3

Re: Obtaining authorization token with code flow

Greg-DB
Dropboxer

The "No auth function available for given request" error should indicate that the excepted parameters for this call were not supplied correctly in the HTTPS request to /oauth2/token.

 

It looks like you're providing the necessary variables, but they may not be getting sent in the right way. How is the array in that second parameter to Http::post getting formatted and sent? The parameters for /oauth2/token should be sent as application/x-www-form-urlencoded POST parameters. 

 

Are you able to print out the raw HTTP request? That may be useful for debugging this. We can't provide support for third party clients, platforms, or libraries though, such as spatie/flysystem-dropbox or Laravel, so I can't offer guidance on exactly how you'd do so. You may need to refer to the relevant documentation for that.

Re: Obtaining authorization token with code flow

Здравко
Super Collaborator | Level 20

Hi @sbartan,

Have you read "Request Data" documentation carefully? Make note on:

By default, data will be sent using the application/json content type

Little bit below could be seen:

If you would like to send data using the application/x-www-form-urlencoded content type, you should call the asForm method before making your request

Hope this helps. 😉

Re: Obtaining authorization token with code flow

sbartan
Explorer | Level 4

Thanks @Здравко, it's working now!

Who's talking

Top contributors to this post

  • User avatar
    sbartan Explorer | Level 4
  • User avatar
    Здравко Super Collaborator | Level 20
  • User avatar
    Greg-DB Dropboxer
What do Dropbox user levels mean?
Need more support?