09-28-2015 05:06
09-28-2015 05:06
Hey, everyone. It's so excited to find such a vibrant community here. Just start to develop Fitbit API recently and encountering some problem. I am working on OAuth 2 with Authorization Code Grant flow. I trigger a callback successfully and get code as a URL parameter just like the document. This is my URL looks like:
http://localhost:3000/auth/fitbit_oauth2/callback?state=XXXXXXXXXXXXXXXXXXXXXXX&code=XXXXXXXXXXXXXXXXX
And I just got locked in exchanging access token with the code.
{
errors: [
{
errorType: "oauth",
fieldName: "code",
message: "Authorization code invalid:XXXXXXXXXXXXXXXXX" }
],
success: false
}
I am doing exchange immediately after I got the code. But it shows me this error again and again.
And I also aware that the code example in the document only has 10 digits ( 1234567890 ), but my code has 40 digits !
Maybe I just use a wrong one ?
09-28-2015 17:14
09-28-2015 17:14
Hi @frozenfung, could you please private message me the Authorization header that you're sending (since it contains your client secret)?
It might also be useful to capture the HTTP request with Runscope to make sure your app is making the request that you think it's making.