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 AnswerHi i wrote to work in Objective-C
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
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 Answer
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 Answer
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
@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 AnswerHi i wrote to work in Objective-C
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