Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Cannot authenticate user

I am having a bit of trouble authenticating my users.

 

I post here to request the tokens.

 

POST /oauth/request_token

 

oauth_token and oauth_verifier are returned.  I pass these to the next function that returns profile XML.

 

But then when I try and call the profile I get this error message...

 

Fatal error: Uncaught exception 'FitBitException' with message 'Fitbit request failed. Code: 401' in /var/www/html/MODULES/fitbitphp-master/fitbitphp.php:325 Stack trace: #0 /var/www/html/MODULES/Fitness_Devices/fitbit_profile.php(37): FitBitPHP->getProfile() #1 {main} thrown in /var/www/html/MODULES/fitbitphp-master/fitbitphp.php on line 325

 

When I check the authentication of the user with the system says that the user is not authenticated.  But I clearly went to the fitbit login section and the proper keys were returned.

 

Can anyone see what I am doing wrong?

 

Thanks.

Best Answer
0 Votes
7 REPLIES 7

What does the body of the 401 HTTP error say? It will describe the problem.

Best Answer
0 Votes
oauthoauth_access_tokenInvalid signature or token 'RZ/U3VnXlZS8uB51njQxSv4bcIs=' or token '7960b1ec71a4d20617f1394b25ef627a'false
Best Answer
0 Votes

As message says you'r probably using invalid signature OR/AND token

Ivan Bahdanau
Senior Software Developer at Fitbit
Best Answer
0 Votes
That's really strange because I am passing the sig and token that is provided by fitbit. I will experiment some more and see if I can figure it out thanks.
Best Answer
0 Votes

Try to generate CURL string and make request from this page: https://dev.fitbit.com/apps/oauthtutorialpage

Ivan Bahdanau
Senior Software Developer at Fitbit
Best Answer
0 Votes
That's good advice I didn't think of that. Thanks.
Best Answer
0 Votes

Are you aware of any way to see what keys are valid keys without passing them to the API?  Perhaps some type of console that lists the available keys.  Even if it is just pulic keys, it would make debugging much easier.

 

Thanks.

Best Answer
0 Votes