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

Problems getting passed OAuth2 with python.

I having a LOT of problems trying to use Fitbit python to access my data on the web.

I have tried registering my App and getting ClientID and Client Secret and a callback to my website. Not sure if I should be specifying Client or Personal

 

I tried to use

https://dev.fitbit.com/apps/oauthinteractivetutorial?clientEncodedId=XXXXXX&clientSecret=YYYYYY&redi...

 

And this opens my home page with the following added to the URL.

#access_token=XXXXX&user_id=YYYYY&scope=heartrate+activity+weight&token_type=Bearer&expires_in=604800

 

From documentation and examples on the web, I was expecting an Authorisation key and not an access token. I was expecting to have to use the supplied Authorisation key to get an access token and refresh token

 

The example python programs that access data seem to expect an access key and also a refresh token and I only seem to have an access token.

Yours extremely frustrated,

Best Answer
0 Votes
1 REPLY 1

Hi @KeithSloan,

 

If you're just accessing your own data, then I would recommend using the "personal" application type in your application settings.  Your application needs to use the authorization code grant flow in order to receive an authorization code that you exchange for the access and refresh tokens.  This includes adding "response_type=code" in your authorize URL.  Here's an example of what that authorize URL would look like

 

https://www.fitbit.com/oauth2/authorize?response_type=code&client_id=XXXXXX&redirect_uri=http%3A%22M...

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