Home Assistant release with the issue:
0.102.1
Last working Home Assistant release (if known):
N/A
Operating environment (Hass.io/Docker/Windows/etc.):
Hass.io
Integration:
https://www.home-assistant.io/integrations/toon
Description of problem:
Starting December 1st, 2019, the Toon API is making changes to its login procedure.
Toon Developers sent me the below:
Starting December 1st, 2019, the Toon API is making changes to its login procedure. Not just for any reason, we’re doing this to make your account more secure.
What does this mean for you?
This means that you will be asked to log in through a separate portal. It will not affect your account or your logged in session.
How to approach the new session lock-out
To proceed, you need to generate a new access token to authorize the connection between your application and your Toon. An explanation for how to continue is here: https://developer.toon.eu/authentication.
At the bottom of the page under “For Headless applications” section, a link is provided to generate a long-lived (10 year) access token. The consumer_key can be found under “My Apps” in the developer portal.
https://api.toon.eu/toonapi-accesstoken?tenant_id=eneco&client_id=<consumer_key>
This link will bring you to Mijn Eneco login page. After login, you will be directed to your access token to use with your Toon API.
The details on how to use the access token is available on this page: https://developer.toon.eu/api-intro
Thanks for understanding. We hope you keep enjoying the API portal, now with an even more secure account.
Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):
N/A
Traceback (if applicable):
N/A
Additional information:
It looks like we will need to switch to using an access-token instead of a consumer key / secret.
Hey there @frenck, mind taking a look at this issue as its been labeled with a integration (toon) you are listed as a codeowner for? Thanks!
Unfortunately, this is handled by the toonapilib we use. I hope that gets updated, if not, I will need some time to write/update it myself.
Lucky for you, this will affect me personally, so I have the drive to get it fixed 😉
@frenck is this a generic issue, affecting all Toon's? Cause i cannot get the integration to work at all.
Also see #28344
I recently was informed about an issue @ Toon/Eneco where they are accidentally split account/duplicated accounts, preventing stuff to work. If you are not one of those unlucky ones, the integration should just still work.
Quby is working on resolving the account issue.
@frenck is it possible to see more logging during the configuration phase, it now shows 'De opgegeven inloggegevens zijn ongeldig.' where i'm sure it's correct (copied from password manager). Or did i miss a step, i kinda in the blind cause i don;t see any errors logged...
@frenck Just ran a check, when i use the "old" authentication url (just in a browser) i get a 'onjuist gebruikersnaam/wachtwoord'. When i use the "new" post december 2019 url (which uses issuer) then i get an error about my app not running on localhost (which seems right).
I guess i need to holdon / wait until the library is updated with the new authentication method (which looks like is added https://github.com/costastf/toonapilib/commit/9ebe76867cee4faa27b4e5c518be120fe82b53a5).
Working on a solution for this.
@frenck How are you doing, everything ok on your side. Was wondering how this issue is going, is there anything i can do to help you on it?
I'm not sure if it's related to this specifically, or if there's a Toon problem.... but since yesterday I'm getting the below. I noticed it after updating to 0.111.3 today, but I think it was there since yesterday as I stopped getting my live stats somewhere yesterday.
2020-06-16 08:53:58 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry qb-xxxxxxxxxxxx-xxxxxxxxxx for toon
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/toonapilib/toonapilib.py", line 149, in _get_challenge_code
code = location.split('code=')[1].split('&scope')[0]
IndexError: list index out of range
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 217, in async_setup
hass, self
File "/usr/src/homeassistant/homeassistant/components/toon/__init__.py", line 82, in async_setup_entry
display_common_name=entry.data[CONF_DISPLAY],
File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/local/lib/python3.7/site-packages/toonapilib/toonapilib.py", line 113, in __init__
self._authenticate()
File "/usr/local/lib/python3.7/site-packages/toonapilib/toonapilib.py", line 157, in _authenticate
code = self._get_challenge_code()
File "/usr/local/lib/python3.7/site-packages/toonapilib/toonapilib.py", line 152, in _get_challenge_code
raise InvalidCredentials(response.text)
toonapilib.toonapilibexceptions.InvalidCredentials
PR is open to replace the current integration in #36952
can't get this problem fixed callback i have changed my callback url just like the documentation please help.
this is my error
The requested redirect_uri does not match any of the whitelisted redirect_uris on the Toon developer page.
Make sure to allow the requested redirect_uri on your registered Toon app in the developer pages
this is my callback url https://192.168.1.9:8123/auth/external/callback
Most helpful comment
Working on a solution for this.