Skip to content

Added option to the authentication that allows you to pass an existing token to tado - #126

Open
aperezm85 wants to merge 1 commit into
mattdavis90:masterfrom
aperezm85:feature/add-authentication-with-existing-token
Open

Added option to the authentication that allows you to pass an existing token to tado#126
aperezm85 wants to merge 1 commit into
mattdavis90:masterfrom
aperezm85:feature/add-authentication-with-existing-token

Conversation

@aperezm85

@aperezm85 aperezm85 commented Mar 31, 2025

Copy link
Copy Markdown

Hello,

I created a new function called authenticateWithToken that allows you to pass an existing token to the authentication.
We can use it to re-use the token that Tado provides in the 10 minutes period (as per Tado documentation).

Please let me know if you are happy with this change or if you need me to do anything else.

Case scenario:
I am using your library on a plugin for the streamdeck that needs to repeat calls to the API and I store the token in cache, if I use the current authenticate, after using the refresh token, the next time I need to click the link again and get a new token. With this approach I think I will not see the token page so often

@mattdavis90

Copy link
Copy Markdown
Owner

The provided authenticate already accepts a refresh token which can be used to re-authenticate. Once authenticated, as long as you're making an API call at least once every 30days you shouldn't ever have to re-authenticate via the device flow. Maybe I'm misunderstanding your use case

@mattdavis90

Copy link
Copy Markdown
Owner

There is also a callback method that you can use to register token changes that may aid your usecase

@aperezm85

Copy link
Copy Markdown
Author

Hi Matt, thanks for your answer.

Let me go back to my issue and think another approach with your suggestions.

Thanks

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.

2 participants