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

Implicit grant flow expire_in not working

ANSWERED

 

[23:00:30] AuthUrl: https://www.fitbit.com/oauth2/authorize?response_type=token&client_id=22D8J2&redirect_uri=https%3A%2F%2Fauth.expo.io%2F%40geniustanley%2Fntuh-ai-lifestyle&scope=activity%20heartrate%20location%20nutrition%20profile%20settings%20sleep%20social%20weight&expires_in=100
[23:00:34] {"type":"success","params":{"exp://172.20.10.9:19000/--/expo-auth-session":"","access_token": "my_token","user_id":"6WGCFC","scope":"weight social profile location settings activity sleep nutrition heartrate","token_type":"Bearer","expires_in":"579536"}}

and this is my async function

    try {             
      console.log(`AuthUrl: ${AUTH_URL}`);
      let authResult = await AuthSession.startAsync({
        authUrl: AUTH_URL
      });             
                      
      if (authResult.type !== "success") {
        return;       
      }               
      console.log(JSON.stringify(authResult));
                                                                                
      return authResult.params.access_token;
    } catch (e) {     
      console.error(e);
      return null;    
    }  

 

While I request an access_token expires in 100s, why it returns 579536

 

Thanks~

 

Best Answer
0 Votes
1 BEST ANSWER

Accepted Solutions

Hi @geniustanley

 

These are the values we support for the "expired_in" parameter

 

86400 for 1 day (default)
604800 for 1 week
2592000 for 30 days
31536000 for 1 year

 

Gordon

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

View best answer in original post

Best Answer
1 REPLY 1

Hi @geniustanley

 

These are the values we support for the "expired_in" parameter

 

86400 for 1 day (default)
604800 for 1 week
2592000 for 30 days
31536000 for 1 year

 

Gordon

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