-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Toon new API authentication #25
Comments
Is the ToonAPIlib4Domoticz compatible with this new authentication method? |
A 10-year-valid access token can now be generated via "https://api.toon.eu/toonapi-accesstoken?tenant_id=eneco&client_id=<consumer_key>". I think this key has to be entered somewhere in the ToonApi to connect to the Eneco site. |
I have followed the instruction in my email and managed to get an "Access token" as stated. But I don't have a clue what to do with it. |
Any news on this? |
Version 4 of the library from Costas now has support for this, but that don't work with this plugin for now. Let me check what I can do to make it work. |
Keep up the good work guys, hate to see it stop working :)
Op za 30 nov. 2019 15:26 schreef Jan Donker <notifications@github.com>:
… Version 4 of the library from Costas now has support for this, but that
don't work with this plugin for now. Let me check what I can do to make it
work.
@JohnvandeVrugt <https://github.com/JohnvandeVrugt> perhaps this is to
complicated for my Python skills but I'll try anyway ;)
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#25?email_source=notifications&email_token=AJWNAS4EDYMJR5QMVS3RCNDQWJZZBA5CNFSM4JQM7Y22YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFQIRFY#issuecomment-559974551>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJWNAS5XUFQU4H6VLCX5PP3QWJZZBANCNFSM4JQM7Y2Q>
.
|
I already have it working with the new V4 library, will do a PR soon |
Great
Op za 30 nov. 2019 15:55 schreef Jan Donker <notifications@github.com>:
… I already have it working with the new V4 library, will do a PR soon
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#25?email_source=notifications&email_token=AJWNAS6DPV6XSALOEIQ6DZLQWJ5HDA5CNFSM4JQM7Y22YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFQJPXQ#issuecomment-559978462>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJWNAS77YRUGV3HI2IJOQOTQWJ5HDANCNFSM4JQM7Y2Q>
.
|
#26 makes this work. The changes are not really hard to do, just run "sudo pip3 install toonapilib -U" and edit "plugin.py" with what I did in the PR. |
Great work!. |
Hi,
Did the adjustments but now its showing below and i do not see device
updates
2019-11-30 17:37:45.534 Error: (toon) 'onStart' failed
'AttributeError':''NoneType' object has no attribute 'smartplugs''.
2019-11-30 17:37:45.534 Error: (toon) ----> Line 112 in
'/home/pi/domoticz/plugins/toonapilib4domoticz/plugin.py', function onStart
2019-11-30 17:37:45.534 Error: (toon) ----> Line 66 in
'/home/pi/domoticz/plugins/toonapilib4domoticz/plugin.py', function on_start
2019-11-30 17:37:45.534 Error: (toon) ----> Line 40 in
'/home/pi/domoticz/plugins/toonapilib4domoticz/devices/device_factory.py',
function create_devices
Op za 30 nov. 2019 om 16:20 schreef Jan Donker <notifications@github.com>:
… #26 <#26> makes
this work.
The changes are not really hard to do, just run "sudo pip3 install
toonapilib -U" and edit "plugin.py" with what I did in the PR.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#25?email_source=notifications&email_token=AJWNASY7SVKXSQQSYB62IVTQWKACNA5CNFSM4JQM7Y22YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFQKKUQ#issuecomment-559981906>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJWNAS4OTWMVFXCGUEN3CXDQWKACNANCNFSM4JQM7Y2Q>
.
|
Then you did not provide an Access Token, sorry I did not tell you to create this first. Sorry for not being complete.. |
Ha, i did but with the wrong consumer key (i have more) and then some
python indent errors to fix (rather strict with last python versions not
used to that :)
all fine now, great job
Op za 30 nov. 2019 om 17:48 schreef Jan Donker <notifications@github.com>:
… Then you did not provide an Access Token, sorry I did not tell you to
create this first.
Please go to "
https://api.toon.eu/toonapi-accesstoken?tenant_id=eneco&client_id=<consumer_key>"
where the consumer key is the value you can find on
https://developer.toon.eu or more specific
https://developer.toon.eu/user/me/apps
Sorry for not being complete..
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#25?email_source=notifications&email_token=AJWNAS5723R4YS5YLYRNAETQWKKMNA5CNFSM4JQM7Y22YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFQNKWA#issuecomment-559994200>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJWNAS7AP6ESLE4VDXJUYHTQWKKMNANCNFSM4JQM7Y2Q>
.
|
Thanks Jan, for doing a good job. |
Toon will use new authentication starting 12/1/2019. See https://developer.toon.eu/authentication for more info.
From December 2019 onwards, Eneco users are required to use the “mijn Eneco” login to access their Toon, use the following call from the application to use the “mijn Eneco” as identity source:
curl -v -k
https://api.toon.eu/authorize?response_type=code
&redirect_uri=<redirect_url>
&client_id=<consumer_key>
&issuer=identity.toon.eu
&tenant_id=eneco
From the ToonAPI website's login page, the end user needs to provide his credentials. A redirect will then be performed to the redirect_uri provided before with a code. The application can now use that code and the application key pair to get an access token that looks like this:
curl -k -X POST
-H "Content-Type: application/x-www-form-urlencoded"
-d "client_id=<consumer_key>
&client_secret=<consumer_secret>
&grant_type=authorization_code
&redirect_uri=<redirect_uri>
&tenant_id=eneco
&code=
"
https://api.toon.eu/token
Again, in this call, when users have logged in via "Mijn Eneco", add the issuer to this request:
curl -k -X POST
-H "Content-Type: application/x-www-form-urlencoded"
-d "client_id=<consumer_key>
&client_secret=<consumer_secret>
&grant_type=authorization_code
&issuer=identity.toon.eu
&redirect_uri=<redirect_uri>
&tenant_id=eneco
&code=
"
https://api.toon.eu/token
The text was updated successfully, but these errors were encountered: