Hello. I have some issues with tokens refreshing.
After I obtained my tokens, I can do the refreshing only a short period of time.
From various reasons, my access_token cannot be refreshing after a few days (~5 days, althought in SmartThings developer write that refresh token expiration is 30 days, so my refresh token is valid). I received the following response
“{
“error”: “invalid_grant”,
“error_description”: “Invalid refresh token: ce65ad60-f007-4f98-9e66-79e2a78a21ab”
}”
Also, in their documentation
" The authToken expiration is five minutes; your SmartApp is expected to make calls to the SmartThings API within this duration after receiving the request from SmartThings. "
But when I do the refresh tokens WS, I receive other value for access_token “token_expiry” = 86400 sec. Which is the correct value for access_token validity and which the reason of the issue refreshing tokens?
I know it is a very late question, but… Were you able to solve the problem? I am struggling with exactly the same issues. Although the documentation states the refresh token is valid for one month my tokens stop to work after about a week. I am seeing the exact same scenario, as you wrote -
I will just leave here a link to the topic connected to Home Assistant.
In my case the scenario was very silly - I was just developing (coding) my solution so I used many breakpoint in the code. If I was already after the token generation, but before token saving - version known to the ST and to my local database were mismatched.