First thank you for this incredible library, I am a beginner in oauth development. I succeeded in using your example printing the user info after haven authenticated on fitbit.com
But the same script doesn't work in a prompt.
Here is the situation:
I have stored the access_token and access_token_secret in hard in my code.
When I run login_with_fitbit.php in my browser it works but not when I do in my terminal > php login_with_fitbit.php.
It says that i do not have credential and server authorization.
I need to do this because my website will make api calls on the user behalf every day in order to analyze the data ( as a daemon and then store the data in a database );
I'm just asking for indications not global solution ;
Lucas Bakalian - 2014-05-14 19:21:00 - In reply to message 4 from Manuel Lemos
Indeed it works great !
Now I can focus on parsing the response in other scripts or to populate the database with access token and users data.
From what I have seen, in the fitbit api they ask for the user id in the url, But We do not need it because I have put directly in the variable $client->access_token and $client->access_token_secret their respective values ( linked to my fitbit test account ) and I have succeeded in retrieving the data.
So is it useful ?
And if it is,
Is their anyway to get it with the Oauth class and variables ? I did no see it in the documentation .
Lucas Bakalian - 2014-05-15 11:20:22 - In reply to message 1 from Lucas Bakalian
Okay I understand more deeply how it works;
Evrything works as you said, And I've noticed that when the user re connects it self on my website ( me with the fitbit test account ) the tokens expires & fitbit returns a new one.
(I've solved this issue which checking in my database)
But if not the access token will stay identical.
I'am mistaking ?
Lucas Bakalian - 2014-05-19 09:13:17 - In reply to message 8 from Manuel Lemos
Thank you for all your responses,
They have been very useful for my project.
Everything works great, I have waiting for 2 days to see if my script would still work and it's the case.
While the token have not expired, they still work, and for them to expire , the user has to re go through connection process. And for this case, my website re update the token, so that's okay.