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

Auth0 token not working in fitbit web api

I logged in successfully with auth0 using social login with Fitbit , but now I need to call fitbit api and its asking me for brearer access token , I got access token and id token from auth0 and tried in fitbit web api but fitbit api not working and giving error like invalide token.

fitbit api url
https://api.fitbit.com/1/user/8Q3RDK/profile.json
and passing header with idtoken which auth0 providing

after calling above url , its giving me error
“errorType”:“invalid_token”,“message”:“Access token invalid:

 

 

Best Answer
0 Votes
2 REPLIES 2

Hi @sanjaymanvani23 

 

The access tokens are specifically tied to the Fitbit user, client ID of the application making the API call and the scopes enabled by the user.   If any of those things don't match, you could receive this error.  You may use https://jwt.io/ to check the contents of the token to verify the user ID, the client ID of your application and if you granted access to the profile data.

 

Gordon

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

In order to access the Fitbit API after logging in to an Auth0 app with a Fitbit social connection, you need to use the identity provider (fitbit) access_token, not the Auth0 id_token.

 

This article explains the process. https://auth0.com/docs/connections/calling-an-external-idp-api

Best Answer
0 Votes