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

oauth2 expired_token despite having refresh_token

This seems to be a well documented problem, but I don't seem to be able to find an actual resolution.

 

I refresh the token, only ever use it once :

 

Array
(
    [access_token] => eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIzWDk5RlgiLCJhdWQiOiIyMjhETEgiLCJpc3MiOiJGaXRiaXQiLCJ0eXAiOiJhY2Nlc3NfdG9rZW4iLCJzY29wZXMiOiJyYWN0IiwiZXhwIjoxNDkwOTI2ODA1LCJpYXQiOjE0OTA4OTgwMDV9.rNTlfHPE1o5kO2tW5QJDQPeMrymowWHNul5kdyUzAjo
    [expires_in] => 28800
    [refresh_token] => f81b3cb2cd7c7be690365a90ad44253a1d86ffa4668a956acb1543c3cc7f8ae4
    [scope] => activity
    [token_type] => Bearer
    [user_id] => 3xxxxx
)

But when I use it, I get an expired_token error:

 

[errors] => Array
        (
            [0] => Array
                (
                    [errorType] => expired_token
                    [message] => Access token expired: eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIzWDk5RlgiLCJhdWQiOiIyMjhETEgiLCJpc3MiOiJGaXRiaXQiLCJ0eXAiOiJhY2Nlc3NfdG9rZW4iLCJzY29wZXMiOiJyYWN0IiwiZXhwIjoxNDkwODk0MTY0LCJpYXQiOjE0OTA4NjUzNjR9.750O2u-8qlj7wCrAT24Xu5Wrwi4r4uYyTMOIYCQO7os. Visit https://dev.fitbit.com/docs/oauth2 for more information on the Fitbit Web API authorization process.
                )

        )

    [success] => 

 I just don't know what I'm doing wrong, everything works properly while the token hasn't expired, and no permissions have been revoked, as it's only me using the account.

 

This is a PHP cURL implementation.

 

What am I doing wrong?

 

Best Answer
0 Votes
2 REPLIES 2

Edit - It seems that the refresh simply isn't having any affect, despite it being called correctly. I can only get it to work, after it has expired, by getting a new authorization_code.

 

Is it anything to do with the fact I'm accessing Intraday Data?

 

Any ideas?

 

 

Best Answer
0 Votes

edited to remove content as worked it out

Best Answer
0 Votes