12-08-2020 08:06
12-08-2020 08:06
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?
12-09-2020 13:16
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
12-09-2020 13:16
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
Best Answer