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

Unable to obtain access token after giving consent inside consent page

I have a react native mobile app to which fitbit is to be integrated. I have used Linking library to open fitbit login page. Once logged in, I'm navigating to "http://www.fitbit.com", which is given as the redirect_uri. But I'm not getting access token as part of this request, due to which I'm unable to access the user data. Can someone please help me on this? 

https://www.fitbit.com/oauth2/authorize?client_id=<clientid>&response_type=token&scope=heartrate%20a...

this is the url i'm hitting to authenticate the user. The client ID in the url has been replaced with <clientid> for security purposes. Please ignore that.

 

 

Best Answer
1 REPLY 1

Hi @christyfrancis,

Welcome to the forums!

It sounds like you're using the Implicit Grant Flow. Are you including all of the necessary parameters in your authorization request? For example: 

Implicit Grant Flow
https://www.fitbit.com/oauth2/authorize?response_type=token
    &client_id=<client ID>
    &redirect_uri=https%3A%2F%2Fexample.com%2Fcallback
    &expires_in=604800
    &scope=activity%20nutrition%20heartrate%20location%20...

I'm not able to see your full authorization url, are you passing the "expires_in" parameter?

Best Answer
0 Votes