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

Lifetime Token

HI i am using C# Fit-bit API everything is working fine and we have already integrated in our app but we are facing one serious issue which is token expiration.

 

In API i have set auto refresh token API is working as expected but when token expires i do not get the fresh token from the existing Refresh Token .

I also set the expiry of token to 1 year but i only get 1 day token.

 

We have integrated other devices they have very good setup i don't know what is the main problem,

 

Is there any way to set the unlimited expiry time for he individual user.

 

 

Regards

 

ATIF

Best Answer
0 Votes
3 REPLIES 3

HI @Lumisoft.  I'm glad you got your C# Fitbit application working.

 

When you use the Refresh Token API, are you getting a new access token, but not refresh token?  What type of authorization flow are you using (Authorization Code Grant Flow, Authorization Code Grant Flow work PKCE or Implicit Grant Flow)?

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

Hi,

 

I am using Authorization Code Grant Flow . I am using .net WEB-API for integration everything is done signup to data sync is working fine but when token expires and backed service try to regenerate new token from the Refresh Token so that part doesn't work.

 

I am using following fitbit c# api

https://github.com/aarondcoleman/Fitbit.NET 

 

Please guide me what would be the cause.

Is there any to get the lifetime token for particular user.

 

waiting for the response.

 

Regards

 

ATIF

Best Answer
0 Votes

Hi @Lumisoft,

 

Would you private message me your Refresh Token API call and the parameter values you're submitting, the behavior you are seeing when requesting a new access token/refresh token pair, and any error messages?

 

The Authorization Code Grant Flow has a very short lived token.  The lifetime of the token is only 28,800 seconds or 8 hours.  Details on the token lifetime can be found in the documentation.  If you set the "expires_in" parameter to a value larger than 28,800 seconds, we will override it and make it 28,800. 

 

The Introspect API call will tell you when the tokens expire.

 

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