Skip to content

Comments

extract home ID from jwt instead of /me during auth#150

Open
karlbeecken wants to merge 5 commits intoerwindouna:mainfrom
karlbeecken:jwt-home-id
Open

extract home ID from jwt instead of /me during auth#150
karlbeecken wants to merge 5 commits intoerwindouna:mainfrom
karlbeecken:jwt-home-id

Conversation

@karlbeecken
Copy link

Proposed Changes

Previously, to acquire the home ID for a user during the login, the /me endpoint on my.tado.com was used.

While this is generally fine, it adds a hard dependency of the auth flow on the availability of my.tado.com, which might be unavailable due to rate limiting. This leads to auth failing if a rate limit is currently in place.

This PR changes that, so that the auth flow extracts the home ID from the auth_token JWT (which also includes that), making the auth flow only dependent on auth.tado.com.

Optionally, we could keep a fallback, so that when the extraction fails, the old get_me is used again to acquire the home ID. I left this out for now, as I don't think it is likely tado will suddenly change the JWTs, and it would add additional branching.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant