08-04-2020 04:44
08-04-2020 04:44
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:
08-04-2020 09:13
08-04-2020 09:13
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
08-27-2020 18:33 - edited 08-27-2020 18:34
08-27-2020 18:33 - edited 08-27-2020 18:34
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