API token invalid after 3 hours despite refresh

Tawi

I am in the process of converting my private weather app to the changed API. Everything is actually working. I get new tokens (access_token/refresh_token) with every request and I also receive the data.

Unfortunately, something is still wrong. I retrieve the data regularly (I know the limit of 3 hours). I seem to be kicked out after ~three hours. Then I have to retrieve a new token via the dev portal and it takes some time again. 

What could I be doing wrong? 

0

Comments

4 comments

  • Comment author
    Leslie Community moderator

    Hello Tawi,

    Now, the access/refresh_token values are changed at each new call to /token endpoint and former values invalidated. So, after 3 hours when it's time to refresh your access_token, you must check in your code that you correctly stored the refresh_token value

    Finally, use it in your refresh_token process, get a new pair of access/refresh_token values in the JSON response, and store the refresh_token for the next /token request

    Have a good day,

    Leslie - Community Manager

    0
  • Comment author
    andre.nader

    Hello Leslie

    If I miss current Refresh token for some reason, is there a request using Client ID, Client Secret and Access Token to get a new one?



    0
  • Comment author
    Leslie Community moderator

    Hi André,

    Unfortunately no, if you "miss" a refresh_token (not correctly stored, incorrect value, ...) you must redo the /authorize process (manually) to get the "code" value at user's redirection and then perform the /token flow to maintain connectivity

    Have a good day,

    Leslie - Community Manager

    0
  • Comment author
    Tawi

    Hey Leslie,
    Thank you for your answer. I did indeed make a mistake last time and had not saved the new tokens correctly.

    1

Please sign in to leave a comment.