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

Increasing the access token expiry time

Hello,

 

I'm working on a Fitbit watch app using OAuth 2.0.  I've set up the application on fitbit.com using the Client type, and I would like to set up the Implicit Grant so that me access token expires in no less than a month.  However, I cannot figure out how to set the expiry time from the default and it still expires too early.

I'm not developing a web app or mobile application so I'm not able to use the link in the Oauth 2.0 tutorial (I think) - so how can I set this up in my Studio project?  How can I extend the expiry time?

Best Answer
0 Votes
1 REPLY 1

Hi @bsavarin 

 

To set the expiration for implicit grant flow tokens you'll use the expires_in parameter in your authorization URL.  See: https://dev.fitbit.com/build/reference/web-api/oauth2/#authorization-page.  

 

Example: 

https://www.fitbit.com/oauth2/authorize?response_type=token&client_id=22942C&redirect_uri=https%3A%2F%2Fexample.com%2Ffitbit_auth&scope=activity%20nutrition%20heartrate%20location%20nutrition%20profile%20settings%20sleep%20social%20weight&expires_in=604800

 

Gordon

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