Fitbit.NET icon indicating copy to clipboard operation
Fitbit.NET copied to clipboard

Invalid signature or token Error

Open Corsicant opened this issue 12 years ago • 5 comments

Hello,

I have been using this client library for a while and it has been working great. However, today I started seeing errors when trying to get approval for my FitBit App. The problem occurs in the Authenticator.ProcessApprovedAuthCallback() method with a response of: {"errors":[{"errorType":"oauth","fieldName":"oauth_access_token","message":"Invalid signature or token 'xxxxxxxxxxxxxxxxx' or token 'xxxxxxxxxx'"}],"success":false}

I see that there was a security update to the FitBit API yesterday and I downloaded the new Fitbit.NET library that was put up a few hours ago (it added "private readonly IRestClient client" as a datamember of Authenticator among other changes). Unfortunately, I am still getting the error.

I tried switching the app over to be a "Desktop App" and using GetAuthCredentialFromPin() and it worked great, but not using ProcessApprovedAuthCallback().

Does this sound like it may be related to the API security fix and any idea what might cause this error?

Corsicant avatar Jan 24 '14 02:01 Corsicant

Yes, that's the issue. The fix is coming tomorrow, but partially updated today with a pull request.

In a pinch, set the RequestTokenSecret property in Authenticator.cs to public and store it in session so you can have it available in the new ProcessApprovedAuthCall which has all required fields to comply with the patch released yesterday.

--Aaron

On Thursday, January 23, 2014, Corsicant [email protected] wrote:

Hello,

I have been using this client library for a while and it has been working great. However, today I started seeing errors when trying to get approval for my FitBit App. The problem occurs in the Authenticator.ProcessApprovedAuthCallback() method with a response of: {"errors":[{"errorType":"oauth","fieldName":"oauth_access_token","message":"Invalid signature or token 'xxxxxxxxxxxxxxxxx' or token 'xxxxxxxxxx'"}],"success":false}

I see that there was a security update to the FitBit API yesterday and I downloaded the new Fitbit.NET library that was put up a few hours ago (it added "private readonly IRestClient client" as a datamember of Authenticator among other changes). Unfortunately, I am still getting the error.

I tried switching the app over to be a "Desktop App" and using GetAuthCredentialFromPin() and it worked great, but not using ProcessApprovedAuthCallback().

Does this sound like it may be related to the API security fix and any idea what might cause this error?

Reply to this email directly or view it on GitHubhttps://github.com/aarondcoleman/Fitbit.NET/issues/17 .

aarondcoleman avatar Jan 24 '14 03:01 aarondcoleman

Thank you for your help and quick response! I was able to use the workaround that you suggested until the the issue gets fully fixed.

Corsicant avatar Jan 24 '14 18:01 Corsicant

I have a same problem, but nobody listen me here. Fortunately somebody else find this bug.

MrMilan avatar Jan 24 '14 22:01 MrMilan

I am trying invoke POST (https://api.fitbit.com/oauth/request_token) from chrome rest console. I have provided the consumer key and oauth_signature_method as 'HMAC-SHA1'. But I am getting below oauth error as response { "errors": [ { "errorType": "oauth", "fieldName": "oauth_signature", "message": "Invalid signature: XBImkZ/ub+b6h78lZTW5SN9aePg=" } ], "success": false }

My 'request_token' Request is:

POST /request_token HTTP/1.1 Host: oauth Authorization: OAuth realm="https:/api.fitbit.com/oauth/request_token",oauth_consumer_key="XXXXXXXX",oauth_signature_method="HMAC-SHA1",oauth_timestamp="1400061325",oauth_nonce="cEkIvy",oauth_version="1.0",oauth_signature="wsr7nP3JN6bVhoUOJvFNfVc1czk%3D" oauth_callback: http://localhost:8083/redirect Cache-Control: no-cache

Could some one please tell me how to get the request_token and what 'oauth_callback' needs to be provide in the request and what needs to be configure in my FITBIT application.

kalyanwsl avatar May 14 '14 09:05 kalyanwsl

I'm afraid that, when I tried it last time ,so I reached the view that this project can not solve it this way and you do it through two windows (tabs) in web browser. Maybe has changed over time and it will be big step forward.

We will see, what say creator.

MrMilan avatar May 14 '14 10:05 MrMilan