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

Getting an error which i am unaware

ANSWERED

I am trying to  get an access token from refresh token.I got this error

 

send: b"POST /oauth2/token HTTP/1.1\r\n

Host:https://api.fitbit.com

User-Agent: python-requests/2.18.4\r\n

Accept-Encoding: g zip, deflate\r\n Accept: */*\r\n

Connection: keep-alive\r\n

authorization: Basic <BASE64 ENCODED client_id:client_secret>

Content-Type: "application/x-WWW-form-encoded\r\n Content-Length: 103\r\n\r\n"
send: b'grant_type=refresh_token&refresh_token=<REFRESH_TOKEN>'
reply: 401
Internal Server Error: /fit_bit/RefAccessToken

 

and an exception I got

 

Received authorization header = Basic <BASE64 ENCODED client_id:client_secret>,  received client encoded id = null.

 

I am following the this code https://github.com/magnific0/FitBit.py

 

Best Answer
0 Votes
1 BEST ANSWER

Accepted Solutions

 

I think there might be an error in the authorization header you are providing. Your authorization header should be in the format: Base64 encoded "client_id:client secret". Can you verify that?

View best answer in original post

Best Answer
0 Votes
1 REPLY 1

 

I think there might be an error in the authorization header you are providing. Your authorization header should be in the format: Base64 encoded "client_id:client secret". Can you verify that?

Best Answer
0 Votes