Closed JorisM closed 10 years ago
Hey,
you have to change the authorization function in heimcontrol.js:61.
This is where the cookie authorization happens. You replace or extend this with your token authorization and return true in the callback-function if your token is valid.
Thanks! I had a wrong approach, I wanted the Server to emit the socketio event. I finally started digging into websockets and now have my android app connecting with a socket. Still WIP but it's getting there.
I want to connect to heimcontrol.js through an API, so I can make an iPhone/Android.
I got an authentication system working with an token key quite easily. I'm stuck however at sending requests with the token to the plugins with socket.io.
To me it seems like socket.io requires a cookie to send requests to the plugins. Do you have an idea how to work around this? So I can just use the token to send requests to the plugins?
I set up an experimental branch, here is my auth token implementation so far: https://github.com/JorisM/heimcontrol.js/commit/9edf819f7c295072fde5ffd2a130f045df99bd8e Thanks