We are developing a Schema Server to integrate with SmartThings (ST) using the Cloud-to-Cloud (C2C) method.
Most features are working as expected, but we’ve encountered an issue related to token refresh behavior.
When ST sends a request to our Schema Server, it includes an access token issued by our OAuth server.
However, even when the token is already expired, ST continues to send the expired token without performing a refresh.
According to the documentation, the Schema Cloud Connector should automatically call the Token Refresh URL configured in the Schema App when the access token expires.
But in our case, we can’t find any logs showing that such a request was made to our refresh URL.
Could you please clarify when or under what conditions ST sends a refresh request to the Token Refresh URL?
And if there are any specific configurations required to enable the automatic token refresh, please let us know.
The App ID is viper_39e43e50-83c9-11f0-bf18-5dc157c1ef2e.
Since we are still in the development phase and not storing logs yet, I’m unable to provide a specific timestamp.
It might be due to a configuration or implementation mistake on my end, so I would really appreciate it if you could share the logic or documentation describing when the refresh token is requested.
Hi, @rocky1
I asked the engineering team about this and they mentioned that on the Token exchange between your Cloud and SmartThings during the account linking, you need to provide the Access Token and Refresh Token along with an expires_in parameter. Once this time expires, the refresh is done.
If this parameter is missing, the Schema integration will attempt to refresh the token after a week.
Thank you for your response.
We’re currently returning the expires_in parameter, so we’re not sure why this issue is occurring.
For now, we’ll try removing the expires_in from the response and extend the token’s validity period to more than a week.
Thank you again for your help.