PHP Classes

Fitbit HTTPS Authentication

Recommend this page to a friend!

      PHP OAuth Library  >  PHP OAuth Library package blog  >  How to Implement PHP ...  >  All threads  >  Fitbit HTTPS Authentication  >  (Un) Subscribe thread alerts  
Subject:Fitbit HTTPS Authentication
Summary:$client->Process() resp: This request should use https protocol.
Messages:11
Author:Jack Hansard
Date:2015-01-08 14:24:06
 
  1 - 10   11 - 11  

  1. Fitbit HTTPS Authentication   Reply   Report abuse  
Picture of Jack Hansard Jack Hansard - 2015-01-08 14:24:06
Hi,

Nice simple use case for once:
- I am using the provided login_with_fitbit.php page and the 22/12/2014 software version
- When I run the page (after inputting my application's id and secret) I get the following message:

OAuth client result

It was not possible to use the application access token.
Error: it was not possible to access the OAuth request token: it was returned an unexpected response status 400 Response: {"errors":[{"errorType":"request","fieldName":"n/a","message":"This request should use https protocol."}],"success":false}

The server is definitely running on https, as is the page itself.

  2. Re: Fitbit HTTPS Authentication   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2015-01-17 05:55:44 - In reply to message 1 from Jack Hansard
Sorry for the delay.

Yes, Fitbit seems to require https in the endpoint URLs to obtain the tokens. I have fixed the oauth_configuration.json file to address this. I will update the class soon but you can make the change yourself too.

  3. Re: Fitbit HTTPS Authentication   Reply   Report abuse  
Picture of sanyogbarve sanyogbarve - 2015-02-01 19:38:45 - In reply to message 2 from Manuel Lemos
Hi,
I know I am expecting too much favor from yours, but could you please mail me a working copy of Fitbit PHP code. I am not able to resolve this error -

OAuth client error

Error: it was not possible to access the OAuth request token: it was returned an unexpected response status 400 Response: {"errors":[{"errorType":"request","fieldName":"n/a","message":"This request should use https protocol."}],"success":false}


Please help me. My Email Id- sanyogbarve@gmail.com

  4. Re: Fitbit HTTPS Authentication   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2015-02-01 22:34:12 - In reply to message 3 from sanyogbarve
The example that comes with the class works perfectly. You just need to use the latest version of the oauth_configuration.json file because it makes the class use the HTTPS endpoint URLs instead of the HTTP old ones that used to work in the past but not anymore.

phpclasses.org/package/7700-PHP-Aut ...

phpclasses.org/package/7700-PHP-Aut ...

  5. Re: Fitbit HTTPS Authentication   Reply   Report abuse  
Picture of sanyogbarve sanyogbarve - 2015-02-02 20:09:16 - In reply to message 4 from Manuel Lemos
Hi Manuel,
Thanks for the reply. Sorry to say but still I am facing the same error. I really would appreciate if you could spend your precious time in looking into my shared code. If possible please review and correct the code.

Link with edit rights-
drive.google.com/folderview?id=0B9s ...


Thanks in advance.

Regards,
Sanyog Barve

  6. Re: Fitbit HTTPS Authentication   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2015-02-02 20:21:57 - In reply to message 5 from sanyogbarve
Sorry, the files in the site were updated. You may try again now using the new oauth_configuration.json file.

  7. Re: Fitbit HTTPS Authentication   Reply   Report abuse  
Picture of sanyogbarve sanyogbarve - 2015-02-03 06:55:33 - In reply to message 6 from Manuel Lemos
Hi Manuel,
No problem at all. Thanks for the update, it really worked. Cheers!!!

  8. Re: Fitbit HTTPS Authentication   Reply   Report abuse  
Picture of sanyogbarve sanyogbarve - 2015-02-04 07:53:19 - In reply to message 7 from sanyogbarve
Hi Manuel,
Pardon me for asking so many question.

Is it possible to pass login credentials from php code itself rather then asking user to fill the user/password.

Scenario - when I call "login_with_fitbit.php" from browser, the page redirects to a login page asking for user credentials.

Without asking user to fill the details, can we manage it internally(at code level).

Regards,
Sanyog Barve

  9. Re: Fitbit HTTPS Authentication   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2015-02-04 08:52:04 - In reply to message 8 from sanyogbarve
OAuth supports authentication with a username and password or with just the client credentials as explained by this article:

phpclasses.org/blog/package/7700/po ...

However, looking at Fitbit OAuth documentation it seems it does not support these types of OAuth flows.

You can still try and see if it works. If not, you may need to ask to FitBit developer support.

wiki.fitbit.com/display/API/OAuth+A ...

It seems to support PIN based authentication, which still may be used for non-Web based OAuth flows.

What is your use case? Why do you need to access the API without user interaction?

  10. Re: Fitbit HTTPS Authentication   Reply   Report abuse  
Picture of sanyogbarve sanyogbarve - 2015-02-04 16:38:24 - In reply to message 9 from Manuel Lemos
Hi Manuel,
Thanks for providing the very useful information.I actually was looking for "Application Only Access with client_credentials".

I am trying to create a wrapper over fitbit, with some extra features for the user.

 
  1 - 10   11 - 11