Skip to content
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

Token encoding doesn't work with Loxone 9.0.9.26 #16

Open
bimcio opened this issue Apr 8, 2018 · 5 comments
Open

Token encoding doesn't work with Loxone 9.0.9.26 #16

bimcio opened this issue Apr 8, 2018 · 5 comments

Comments

@bimcio
Copy link

bimcio commented Apr 8, 2018

Hi,
my Loxone is currently running firmware 9.0.9.26 and I am connecting using 'AES-256-CBC'. This works fine. But as this mode is no longer supported in the latest version, before upgrading I wanted to make sure the 'Token-Enc' works. Unfortunatelly I was not able to make it work. I always get 401 when trying to call jdev/sys/gettoken:

test_loxapi.js:20
2018-04-08T19:34:37.992Z DEBUG: Loxone text message: {"LL":{"control":"jdev/sys/gettoken/849284a2e6455148d253c8e2f4ff85bf4fc43202/admin/2/edfc5f9a-df3f-4cad-9dddcdc42c732be2/nodeloxWSAPI","value":{"lastE...(210)
test_loxapi.js:20
2018-04-08T19:34:37.993Z INFO : Loxone auth error: {"type":"control","data":{"LL":{"control":"jdev/sys/gettoken/849284a2e6455148d253c8e2f4ff85bf4fc43202/admin/2/edfc5f9a-df3f-4cad-9dddcdc42c732be2/nodeloxWSAPI","value":{"lastEdit":"2009-01-01 01:00:00","unix":1230768000},"code":"401"}},"control":"jdev/sys/gettoken/849284a2e6455148d253c8e2f4ff85bf4fc43202/admin/2/edfc5f9a-df3f-4cad-9dddcdc42c732be2/nodeloxWSAPI","value":{"lastEdit":"2009-01-01 01:00:00","unix":1230768000}}

Bartek

@alladdin
Copy link
Owner

alladdin commented Apr 9, 2018

I have the same version of the firmware on my miniserver and 'Token-Enc' works.
Make sure that you have correct credentials and latest version of node-lox-ws-api.

@bartekmotyl
Copy link

I have used the test program from node-lox-ws-api-testing with following line:
var lox = new LoxoneAPI("192.168.1.100", "admin", "password", true, 'AES-256-CBC');
This works. After changing the last parameter to 'Hash' it still works.
When changed to 'Token-Enc' (leaving the other parameters unchanged) it doesn't work anymore.

Can you maybe suggest what else I can check? (I am running the test on Windows 10)

@bimcio
Copy link
Author

bimcio commented Apr 16, 2018

Btw. The same happens when trying to connect to demominiserver.loxone.com:7779 (u:web pass:web).
Login from browser works fine, does not work from node-lox-ws-api-testing.
This demo server is running 9.3.3.26 (so no other way to login but TokenEnc).

@bimcio
Copy link
Author

bimcio commented Apr 16, 2018

Hmm, I just realized I made a mess, sorry. 'bartekmotyl' is my second github account (corporate), I haven't noticed I was logged in with another account. Anyway, all the comments above are from me.

@idoodler
Copy link

Loxone just published its own node.js module that handles authentication, encryption and tokens in an easy way.

Its version 0.9 but it will work, I am using it in one of my own projects for a while now. (Yes, I am an Loxone employee...)

You may wanna check it out: LxCommunicator

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

No branches or pull requests

4 participants