12-15-2016 19:44
12-15-2016 19:44
Hi everyone ..
This is my first interaction with fitbit auth and awful exp. my app written in Obj-c , there are not enough tutorial or example .. however i got this link to use http://stackoverflow.com/questions/36915238/get-authorization-from-fitbit-using-oauth-in-ios
but always getting stuck with error invalid_client , when i use same auth code at hurl.it it works but not in app , will be great help if someone guide me
Thanks Alot
Answered! Go to the Best Answer.
Best Answer02-02-2017 20:21
02-02-2017 20:21
Hi i wrote to work in Objective-C
12-17-2016 15:05
Community Moderator Alumni are previous members of the Moderation Team, which ensures conversations are friendly, factual, and on-topic. Moderators are here to answer questions, escalate bugs, and make sure your voice is heard by the larger Fitbit team. Learn more
12-17-2016 15:05
@iosDev What's the specific error? Invalid_client is just the error type.
Best Answer12-18-2016 19:48
12-18-2016 19:48
First of all thank you for your response , it really too fast 🙂
always it fails with error 400 or if i successfully remove 400 then 401 , and in response i received some NSData , after serializing it error type invalid client blah blah ....
do i'm using right steps ??
like link i posted says i will get auth auto , but i need to fillter callbackurl to get auth is it right ??
Best Answer12-19-2016 03:47 - edited 05-09-2017 05:31
12-19-2016 03:47 - edited 05-09-2017 05:31
here is error
{ URL: https://api.fitbit.com/oauth2/token } { status code: 400, headers {
"Cache-Control" = "no-cache, private";
"Content-Encoding" = gzip;
"Content-Language" = "en-IN";
"Content-Type" = "application/json;charset=utf-8";
Date = "Mon, 19 Dec 2016 11:46:15 GMT";
Server = "cloudflare-nginx";
Vary = "Accept-Encoding";
"cf-ray" = "313a9ce7b9212f05-DEL";
"x-frame-options" = SAMEORIGIN;
} }
{
errors = (
{
errorType = "invalid_grant";
message = "Authorization code invalid: eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiI1NDNWNzUiLCJhdWQiOiIyMjdZRDkiLCJpc3MiOiJGaXRiaXQiLCJ0eXAiOiJhY2Nlc3NfdG9rZW4iLCJzY29wZXMiOiJ3aHIgd251dCB3cHJvIHdzbGUgd3dlaSB3c29jIHdzZXQgd2FjdCB3bG9jIiwiZXhwIjoxNDgyNzQ5OTQwLCJpYXQiOjE0ODIxNDc5NjB9.TD7XryjrY_CMelAIResEJRlj0MvywX91BxWh328TGsA Visit https://dev.fitbit.com/docs/oauth2 for more information on the Fitbit Web API authorization process.";
}
);
success = 0;
}
Best Answer12-20-2016 15:25
Community Moderator Alumni are previous members of the Moderation Team, which ensures conversations are friendly, factual, and on-topic. Moderators are here to answer questions, escalate bugs, and make sure your voice is heard by the larger Fitbit team. Learn more
12-20-2016 15:25
@iosDev wrote:
errorType = "invalid_grant";
message = "Authorization code invalid: eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiI1NDNWNzUiLCJhdWQiOiIyMjdZRDkiLCJpc3MiOiJGaXRiaXQiLCJ0eXAiOiJhY2Nlc3NfdG9rZW4iLCJzY29wZXMiOiJ3aHIgd251dCB3cHJvIHdzbGUgd3dlaSB3c29jIHdzZXQgd2FjdCB3bG9jIiwiZXhwIjoxNDgyNzQ5OTQwLCJpYXQiOjE0ODIxNDc5NjB9.TD7XryjrY_CMelAIResEJRlj0MvywX91BxWh328TGsA Visit https://dev.fitbit.com/docs/oauth2 for more information on the Fitbit Web API authorization process.";
@iosDev Looks like you're using an access token where you should be using an authorization code. See Access Token Request.
If you want to refresh an expired access token, then you need to use the refresh token.
Best Answer02-02-2017 20:21
02-02-2017 20:21
Hi i wrote to work in Objective-C
02-04-2017 10:51
Community Moderator Alumni are previous members of the Moderation Team, which ensures conversations are friendly, factual, and on-topic. Moderators are here to answer questions, escalate bugs, and make sure your voice is heard by the larger Fitbit team. Learn more
02-04-2017 10:51
@iosDev Thanks for sharing!
Best Answer