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

Re: Make your OAuth2.0 request in less than 1 minute.

curl: (6) Could not resolve host: Basic
curl: (6) Could not resolve host: 'vgjhgfvjhjhgjyhgjgjhgjhgjhgjhgjhjhgjgh'
curl: (6) Could not resolve host: application
HTTP/1.1 401 Unauthorized
Date: Mon, 04 Aug 2019 16:46:04 GMT
Content-Type: application/json;charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Cache-Control: no-cache, private
CF-Ray: 504a389990ccvssd7104b-ORD
Content-Language: en-CA
Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
Vary: Origin,Accept-Encoding
WWW-Authenticate: Bearer realm="api.fitbit.com"
X-Frame-Options: SAMEORIGIN
X-Frame-Options: SAMEORIGIN
Server: cloudflare

{"errors":[{"errorType":"invalid_client","message":"Invalid authorization header format. The header was not recognized to be a valid header for any of known implementations or a client_id was not specified in case of a public client Received header = null. Visit https://dev.fitbit.com/docs/oauth2 for more information on the Fitbit Web API authorization process."}],"success":false}

 

 

Why am I getting this as my CURL response? Kindly help, thanks.

Best Answer
0 Votes
3 REPLIES 3

Hi @ShreeTya 

 

Below is an example of a curl statement taken from the OAuth 2.0 Tutorial referenced in the original post.  Based on the error message, it looks like you have a syntax error with the authorization call.  If this example doesn't help correct your syntax issue, please reply with the curl statement you're trying to execute.

 

curl -X POST -i https://api.fitbit.com/oauth2/token
-H 'Authorization: Basic <token>'
-H 'Content-Type: application/x-www-form-urlencoded'
-d "clientId=22DPJN"
-d "grant_type=authorization_code"
-d "redirect_uri=https%3A%2F%2Foauth.net%2Fcallback"
-d "code=<authorization code>"

 

 

Gordon Crenshaw
Senior Technical Solutions Consultant
Fitbit Partner Engineering & Web API Support | Google
Best Answer
0 Votes

Thanks for your response. The problem isn't solved as yet with the new syntax that you just provided. commandln response was :The system cannot find the file specified.

 

The initial curl from my OAuth2.0 request for Authorization Code Flow :

curl -X POST -i -H 'Authorization: Basic XYZ' -H 'Content-Type: application/x-www-form-urlencoded' -d "clientId=22Mk23M" -d "grant_type=authorization_code" -d "redirect_uri=https%3A%2F%2Fwww.google.com%2F" -d "code=123" https://api.fitbit.com/oauth2/token

Best Answer
0 Votes

Hi @ShreeTya 

 

I have created a support case for this problem and will reply to you via the case.

 

Gordon

Gordon Crenshaw
Senior Technical Solutions Consultant
Fitbit Partner Engineering & Web API Support | Google
Best Answer
0 Votes