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

Display Authentication Page on another host/computer

Hi Fitbit Community,

 

I am very new to OAuth 2 so I apologize in advance if this is a stupid question. Right now my fitbit app only works with callback URL set to:

http://127.0.0.1:8080/

It opens the authentication window on my computer browser and everything works great.

However, I need to run my program on a remote Linux machine that I only have access to through terminal. The authentication window cannot be shown because there is no browser on that machine; and when I run it it says 8080 port not available for use. Is is possible for the authentication window to be redirected back to my machine instead of localhost so that I can authenticate the login attempt? Thank you!

 

Dennis Lin

Best Answer
0 Votes
6 REPLIES 6

Hi @linneverstops 

 

The authentication/consent screen is for another Fitbit user to consent sharing their data with your application.  The consent screen is going to be shown through their web browser or mobile device.   Enter your complete authorize URL, https://www.fitbit.com/oauth2/authorize/..., into another browser window on another machine or mobile device.  When you consent, the user will redirect back to your machine.   You'll need to make certain the redirect URL is accessible outside your firewall.   If the URL is not accessible, the web page will not load.   The access token or authorization code will still be visible in the URL.  You can manually copy it back to your Linux machine.   For testing purposes, this is ok.  It should be fixed for production use to provide a seamless user experience.

Gordon Crenshaw
Senior Technical Solutions Consultant
Fitbit Partner Engineering & Web API Support | Google
Best Answer

Hi @GordonFitbit 

 

Thank you for your quick response! I am a Masters student performing a research on a group of participants and each will be given a fitbit; and then I will be pulling data for research purposes. Therefore, the users/participants will not have access to the consent screen (they signed a consent to participate in the study). I apologize if I have not described my question well. 

 

I am running a data export Python program that include authentication on a remote cluster. I want to know if there is a way to authorize users on my computer while the program is running on a remote cluster since the remote cluster do not support a web browser. Do I manually enter the authorize URL on my machine when the program in the remote cluster attempts to authenticate? Or does the consent window has to be shown on the same machine the data export is currently running? 

Sorry for the confusion and thank you for your time and help!

 

Dennis Lin

Best Answer
0 Votes

Hi @linneverstops 

 

Unfortunately, the only process we allow application developers and researchers to collect data is through our OAuth 2.0 consent flow.   It doesn't matter which machine the user enters the URL to authorize consent.   When they enter the URL into a web browser (computer, mobile device, tablet, etc), the consent screen will be displayed for your application.   The user will need to log in to their Fitbit account and consent to the data scopes you want to collect.   Afterwards, we will redirect back to your machine via the provided callback URL.

 

The consent window does not need to be shown on the same machine the data export is running.  It's best if the participants in your research study consent on their own device.   If this still doesn't make sense, please private message me and we can setup a demo.

 

Gordon Crenshaw
Senior Technical Solutions Consultant
Fitbit Partner Engineering & Web API Support | Google
Best Answer
0 Votes

@GordonFitbit  Thank you for your continuous support. I will private message you.

 

Dennis

Best Answer
0 Votes

Hi GordonFitbit,

 

I know this is an old thread, but I have the same question! Is there any way to complete Oauth from a remote machine that doesn't have a browser? For reference, I'm just interested in my OWN data, no one else's, but I am running my code/website off of a raspberrypi which I only have access to via terminal, and for which I cannot open a browser. I was hoping to get nightly or perhaps just weekly pulls of my own data via API to this remote host.

Best Answer
0 Votes

Hi @vgmiller 

 

Consent is performed through a webform.  This is a requirement for any application that uses the Web APIs.   If your development environment does not support loading a webform, you can copy/paste the authorization URL on a machine that does have a web browser.  The redirect URL will attempt to connect back to your development system.  If that is not possible, copy/paste the authorization code into the terminal window and complete the authorization flow.

 

Gordon

Gordon Crenshaw
Senior Technical Solutions Consultant
Fitbit Partner Engineering & Web API Support | Google
Best Answer
0 Votes