Websocket (wss) to home.myopenhab.org

I’m trying to connect to home.myopenhab.org with websocket (wss). I use the following address: wss://home.myopenhab.org/ws?accessToken=token, where I tried to use both base64(username:password) and a generated API token from myopenhab as token. Every time i connect i get error: Unexpected server response: 401. I’m able to connect through the rest api https://home.myopenhab.org/rest/ but since i want to use websocket, this is not enough for me. How do I authenticate correctly with websocket?

Unfortunately I do not know the answer to your question. However there are two layers of authentication to get through and I wonder if that’s the root of the problem.

First you must authenticate to the myopenhab.org server. I believe basic auth is the only thing that’s supported there. But once you’ve done that, depending on how you’ve configured OH (e.g. disabled the implicit user role) you’ll need to authenticate again to your OH server.

I’ve no idea how to do that in one request or whether that’s even possible in one request.

Websockets are not yet supported in the cloud service, although there is a PR open for it which i am going to review shortly

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.