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: 

"No auth function available for given request" return on /token request

"No auth function available for given request" return on /token request

jenseno
Explorer | Level 4

Hi. I send the following form data with the code I got from the authorization page. I use redirect_uri back to my app through localhost.

 

However I get the following response (error code 400): "No auth function available for given request".

My request form data looks like this:

 

Header:

POST /oauth2/token HTTP/1.1
Host: api.dropboxapi.com
User-Agent: UnityPlayer/5.5.2f1 (UnityWebRequest/1.0, libcurl/7.46.0-DEV)
Accept: */*
Accept-Encoding: identity
X-Unity-Version: 5.5.2f1
Content-Length: 177

 

Post data:

code=KNJIALLS_WCAAAAAAABSTZP97AYWIZJPX9B1A6CBFUC&grant_type=authorization_code&client_id=<removed for security>&client_secret=<removed for security>&redirect_uri=http%3A%2F%2F127.0.0.1%3A6756

 

I could not find anything on google or the forums, so now I'm trying here.

I can see that auth authorization is missing (Authorization bearer) but the docs said nothing about this, and I don't have a token at this stage in the process anyway.

 

Thanks in advance

 

Odin Jensen

 

 

 

22 Replies 22

jenseno
Explorer | Level 4

Actually my problem was that I accidentially upper cased the request code, due to copy paste og some other code 😉

So I guess you need to make sure that the code you get from Dropbox API is not modified in any way, before you request the token

 

Regards

 

Odin

Greg-DB
Dropbox Staff

@bruce0205 If that doesn't seem to be the issue in your case, please supply the code to reproduce the issue for your case.

Laurent22
Explorer | Level 4

In my case I had this issue because I was using the wrong content type to post the data.

This endpoint is actually very confusing because unlike all the other endpoints (which accept application/json) it accepts application/x-www-form-urlencoded, and if you use the wrong format it will respond with this absurd error message "No auth function" even though there can't be an auth token at that point.

 

In my tests other mistakes in the data format (like missing client ID or secret) also resulted in this error .

 

From the doc it's unclear whether client ID and secret are required or not (I have no idea what "If credentials are passed in POST parameters" means in this context) but they seem to be required anyway.

 

So in my case I eventually got it working using this kind of request:

 

curl -v -F 'client_id=REMOVED' -F 'client_secret=REMOVED' -F 'code=REMOVED' -F 'grant_type=authorization_code' https://api.dropboxapi.com/oauth2/token

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Laurent22 Explorer | Level 4
  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    jenseno Explorer | Level 4
  • User avatar
    bruce0205 New member | Level 2
What do Dropbox user levels mean?