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

Can anyone see the error

Hello,

 

I am using the lastest .NET Fitbit api (release candidate) and i managed to get the callback working and I am getting a code back. But apparantly the string I get from the Fitbit website has errors in it 😞

 

 

            var appCredentials = new FitbitAppCredentials()
            {
                ClientId = "228WTX",
                ClientSecret = "9285b7a46c774675acff183d41fafb9d"
            };
 
            var authenticator = new OAuth2Helper(appCredentials, "https://healtheportal.nl/test/patient/Fitbit/Callback");
               
           
 
            OAuth2AccessToken accessToken = await authenticator.ExchangeAuthCodeForAccessTokenAsync(pat.AuthToken);
 
            //Store credentials in FitbitClient. The client in its default implementation manages the Refresh process
            var fitbitClient = GetFitbitClient(accessToken);
 
I only get a FitbitToken error sadly 😞 Is there anyone that knows what might be going wrong?

 

 

 

 

 

Best Answer
0 Votes
2 REPLIES 2

for some reason this is the error in the response:

Root = {{
  "errors": [
    {
      "errorType": "invalid_grant",
      "message": "Authorization code invalid: 2599c600a1b2a08740b35e08159f73cb55e51b75 Visit https://dev.fitbit.com/docs/oauth2 for more information on the Fitbit Web API authorization process."...

 

However this is the exact code i get from the Fitbit response code=2599c600a1b2a08740b35e08159f73cb55e51b75

The authorization seems to be a 100% correct ?

 

Best Answer
0 Votes

We can't debug your code, but we'll gladly look at the actual HTTP requests your application is making.

 

Could you try capturing all of your Fitbit API requests using Runscope Traffic Inspector to verify?

 

Is it possible that you are making the Access Token Request multiple times?

Best Answer
0 Votes