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: 

Re: 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

Greg-DB
Dropbox Staff

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.

Здравко
Legendary | 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. 😉

sbartan
Explorer | Level 4

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

Need more support?