w.Intercom = i;img.ProfilePhoto.ProfilePhotoMedium { padding: 10px; }API device code grant flow assistance — tado° Community

API device code grant flow assistance

Hi

I use the "password grant flow" method of accessing the Tado API using code built on an ESP8266. I have received a mail telling me that I will now need to move to a "device code grant flow" authorisation process, and example of the process is given.

When I follow the example I get to a point which shows this request:

req = requests.post(
"https://login.tado.com/oauth2/token",
params=dict(
client_id="1bb50063-6b0c-4d11-bd99-387f4a91cc46",
device_code="XXX_code_XXX",
grant_type="urn:ietf:params:oauth:grant-type:device_code",
)
)

Giving this response:

{'access_token': 'myAccessToken',
'expires_in': 3599,
'refresh_token': 'myRefreshToken',
'scope': 'offline_access',
'token_type': 'Bearer',
'userId': '...'}

However when I execute for my device code I get:

{
"access_token": "myAccessToken",
"expires_in": 599,
"token_type": "Bearer",
"userId": "…"
}

So, differing expiry and no refresh_token.

Is there somebody that has successfully implemented this who can steer me in the right direction please?

I am for from an expert in anything HTTP(s), so treat me as a novice please.

Cheers.

Answers